Wednesday, December 30, 2015

basics file management linux

hey this is the first file and yes i am exciterd[ashok@new-host-4 ~]$ cd aaa
[ashok@new-host-4 aaa]$ ls -l
total 0
drwxrwxr-x. 3 ashok ashok 16 Dec 28 23:20 bbb
[ashok@new-host-4 aaa]$ ls -a
.  ..  bbb
[ashok@new-host-4 aaa]$ touch ashok
[ashok@new-host-4 aaa]$ cat ashok
[ashok@new-host-4 aaa]$ cat>> ashok
hey this is the first file and yes i am exciterd^C
[ashok@new-host-4 aaa]$



mkdir -p command creates a parent directory if not existed already
 for eg: here it creates thesis as a parent directory along with [ashok@new-host-4 ~]$ mkdir -p thesis/chapter1 thesis/chapter2
l[ashok@new-host-4 ~]$ mkdir -p thesis/chapter1 thesis/chapter2
[ashok@new-host-4 ~]$ ls - R thesis
thesis:
chapter1  chapter2
 ls -R = listing recursive directories along with the files
 cp -R = to copy non empty directories ( - r especially used for doing anything with the  non empty touch song{directories
 ~+ = current working directory
 brace expansion: [ashok@new-host-4 globe]$ echo file{a,b}{1,2}
filea1 filea2 fileb1 fileb2
 command subsitution:
 `(backsticks not single inverted commas ) are quite old ..
 now used $() instead of backsticks ..$() can form even nested loops but backsticks cannot 
 single inverted commas '' cannot redirect command substituition but "" does
 processes::
 ps command =listing current processes
 ps -aux = all processes with columns and includes processes without a controlling terminal
User       PID  %CPU  %mem    VSZ  RSS TTY STAT     START TIME  COMMAND
 root        39  0.0  0.0      0     0 ?        S    01:35   0:00 [rcuob/30]
root        40  0.0  0.0      0     0 ?        S    01:35   0:00 [rcuob/31]
root        41  0.0  0.0      0     0 ?        R    01:35   0:23 [rcu_sched]
root        42  0.0  0.0      0     0 ?        S    01:35   0:20 [rcuos/0]
root        43  0.0  0.0      0     0 ?        S    01:35   0:00 [rcuos/1]
also ps-lax = long listing option but avoids username lookup so is faster comparativelyps - 
ps -ef also is alos a similiar unix command

Running jobs in the background::
& sign runs th job in background
(%job number )  reconnect to the controlling terminal bringing back to the foreground



No comments:

Post a Comment