Linux Commands: (These Cmds R Exec On My Terminal Try It)
Linux Commands: (These Cmds R Exec On My Terminal Try It)
--to change
vishal@vishal-desktop:~$ stty kill \^k
vishal@vishal-desktop:~$ stty -a
speed 38400 baud; rows 39; columns 125; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^K; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; 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
-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
--for heading
vishal@vishal-desktop:~$ who -H
NAME LINE TIME COMMENT
vishal tty7 2009-11-17 20:19 (:0)
vishal pts/0 2009-11-17 20:37 (:0.0)
To print/set date
vishal@vishal-desktop:~$ date
Tue Nov 17 21:04:38 IST 2009
--options to set are
date -t
date -u
To display calender
--by default current
vishal@vishal-desktop:~$ cal
November 2009
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
To terminate process
syntax
$kill [signal no.] PID(s)
//in linux der r 32 signal each perform individual tasks
for perticular proc u can chk pid by $ps currently running
eg:$kill 105
#it will terminate proc with PID 105
to send perticular process in background “&” is used
to kill bg proc
Eg;$sort -o stud stud1 &
345
(it will sort stud file and put it in stud1 in background and return PID of proc)
to kill bg proc cmd is $!
eg:-kill $! (kill sort proc)
$kill 0 (will terminate all proc except shell)
--to display
vishal@vishal-desktop:~/Desktop/Vishal$ cat vish.txt
Hi myself Vishal
I m creating vish.tx
This is placed in vishal folder
--to append
vishal@vishal-desktop:~/Desktop/Vishal$ cat vish.txt>>v1.txt
--to number
vishal@vishal-desktop:~/Desktop/Vishal$ cat -n vish.txt
1 Hi myself Vishal
2 I m creating vish.tx
3 This is placed in vishal folder
Listing file/dir
vishal@vishal-desktop:~/Desktop/Vishal$ pwd
/home/vishal/Desktop/Vishal
--to list
vishal@vishal-desktop:~/Desktop/Vishal$ ls
v1.tx v1.txt vish.txt
--list horizontly
vishal@vishal-desktop:~/Desktop/Vishal$ ls -x
v1.tx v1.txt vish.txt
--list alphabetically
vishal@vishal-desktop:~/Desktop/Vishal$ ls -c //use -r to reverse sort
v1.txt v1.tx vish.txt
r-read permission
w-write
x-exec
1st perm is for user,2nd perm is for group,3rd perm is for others
Changing directories
$cd [path] //if path not given place u at ur home dir
copying
vishal@vishal-desktop:~/Desktop/Vishal$ cp vish.txt vish/v
moving/renaming file
vishal@vishal-desktop:~/Desktop/Vishal$ ls
v1.tx v1.txt vish vish.txt
vishal@vishal-desktop:~/Desktop/Vishal$ mv v1.tx vish.doc
vishal@vishal-desktop:~/Desktop/Vishal$ ls
v1.txt vish vish.doc vish.txt
vishal@vishal-desktop:~/Desktop/Vishal$ ls -l vish.doc
-rwxr--r-- 1 vishal vishal 69 2009-11-17 22:09 vish.doc
--exec to all(-a)
vishal@vishal-desktop:~/Desktop/Vishal$ chmod a+x vish.doc
vishal@vishal-desktop:~/Desktop/Vishal$ ls -l vish.doc
-rwxr-xr-x 1 vishal vishal 69 2009-11-17 22:09 vish.doc