Monday, 3 September 2012

Unix Handies

Unix Handnotes:

As far as I am concerned Unix is undoubtedly the Best operating system!!.In simple terms when we see the disadvantages of Unix to Microsoft/Mac I can say that GUI is only feature that Unix lags.But at the same time that is the most inevitable adavantages over the other operating systems..!

Here we go...Some of the ery useful things (say even unique feature ) with Unix,

(1) Use script command to record your sessions . I will quote with the real time scenario for further understanding.

bash-3.2$ script mak_del_dir
Script started, file is mak_del_dir
bash>mkdir test
bash >cd test
bash>cat file1
cat: file1: No such file or directory
bash >rmdir test
bash >exit
Script done, file is mak_del_dir

Now we have recorded the session of creating a dir and deleted and this session is recored using the script <file name> cmd and the recorded session can be viewed by using the cat <file name>

(2) cal cmd

      By using this command we will be able to view any date/day/month/year

       bash-3.2$ cal 1 1990
  January 1990
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

(3) For Terminal Settings Use stty -a

bash-3.2$ stty -a
speed 38400 baud; rows 37; columns 184; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;
min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

We can also set /change any setting as per our needs
For eg:
if the interrupt shoul be ^j instead of ^C then
 bash-3.2$ stty intr "^J"

(4) For sending mails using Unix:

Mailx command allows the user to send and recieve mails in unix machine.


No comments:

Post a Comment