Linux practical

download Linux practical

If you can't read please download the document

description

linux basic commands

Transcript of Linux practical

login as: [email protected]'s password:Last login: Wed Aug 19 00:21:25 2015 from 192.168.1.11[root@inam ~]# ls -lrttotal 76-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktop[root@inam ~]# cd /[root@inam /]# ls -lrttotal 172drwxr-xr-x 2 root root 4096 Feb 17 2010 srvdrwxr-xr-x 2 root root 4096 Feb 17 2010 optdrwxr-xr-x 2 root root 4096 Feb 17 2010 mntdrwxr-xr-x 2 root root 4096 Feb 17 2010 mediadrwx------ 2 root root 16384 Aug 18 23:27 lost+founddrwxr-xr-x 2 root root 4096 Aug 18 23:29 selinuxdrwxr-xr-x 14 root root 4096 Aug 18 23:31 usrdrwxr-xr-x 3 root root 4096 Aug 18 23:41 tftpbootdrwxr-xr-x 13 root root 12288 Aug 18 23:52 libdrwxr-xr-x 3 root root 4096 Aug 18 23:52 bootdrwxr-xr-x 26 root root 4096 Aug 18 23:54 vardrwxr-xr-x 2 root root 4096 Aug 18 23:59 bindrwxr-xr-x 2 root root 12288 Aug 18 23:59 sbindrwxr-xr-x 3 root root 4096 Aug 19 00:01 homedrwxr-xr-x 3 root root 4096 Aug 19 00:02 u01drwxr-x--- 14 root root 4096 Aug 19 00:09 rootdr-xr-xr-x 106 root root 0 Aug 19 21:49 procdrwxr-xr-x 11 root root 0 Aug 19 21:49 sysdrwxr-xr-x 115 root root 12288 Aug 19 21:50 etcdrwxr-xr-x 2 root root 0 Aug 19 21:50 miscdrwxr-xr-x 2 root root 0 Aug 19 21:50 netdrwxrwxrwt 9 root root 4096 Aug 19 21:50 tmpdrwxr-xr-x 11 root root 3600 Aug 19 21:50 dev[root@inam /]# cd /u01[root@inam u01]# lslost+found[root@inam u01]# hostname -i192.168.1.29[root@inam u01]# cat /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail.127.0.0.1 localhost.localdomain localhost::1 localhost6.localdomain6 localhost6192.168.1.29 inam.oracle.com inam[root@inam u01]# ping 192.168.1.29PING 192.168.1.29 (192.168.1.29) 56(84) bytes of data.64 bytes from 192.168.1.29: icmp_seq=1 ttl=64 time=0.037 ms64 bytes from 192.168.1.29: icmp_seq=2 ttl=64 time=0.042 ms64 bytes from 192.168.1.29: icmp_seq=3 ttl=64 time=0.035 ms

--- 192.168.1.29 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2000msrtt min/avg/max/mdev = 0.035/0.038/0.042/0.003 ms[root@inam u01]#[root@inam u01]#[root@inam u01]#[root@inam u01]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda1 11G 3.6G 6.4G 37% //dev/sda5 42G 177M 39G 1% /u01/dev/sda2 3.8G 72M 3.6G 2% /tmptmpfs 589M 0 589M 0% /dev/shm[root@inam u01]# df -kFilesystem 1K-blocks Used Available Use% Mounted on/dev/sda1 10908508 3731796 6613636 37% //dev/sda5 43089760 180240 40685324 1% /u01/dev/sda2 3968124 73684 3689612 2% /tmptmpfs 602904 0 602904 0% /dev/shm[root@inam u01]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda1 11G 3.6G 6.4G 37% //dev/sda5 42G 177M 39G 1% /u01/dev/sda2 3.8G 72M 3.6G 2% /tmptmpfs 589M 0 589M 0% /dev/shm[root@inam u01]# cd /[root@inam /]# cd[root@inam ~]# su - oracle[oracle@inam ~]$ exitlogout[root@inam ~]#[root@inam ~]# pwd/root[root@inam ~]# cd /[root@inam /]# lsbin dev home lost+found misc net proc sbin srv tftpboot u01 varboot etc lib media mnt opt root selinux sys tmp usr[root@inam /]# ls -lrttotal 172drwxr-xr-x 2 root root 4096 Feb 17 2010 srvdrwxr-xr-x 2 root root 4096 Feb 17 2010 optdrwxr-xr-x 2 root root 4096 Feb 17 2010 mntdrwxr-xr-x 2 root root 4096 Feb 17 2010 mediadrwx------ 2 root root 16384 Aug 18 23:27 lost+founddrwxr-xr-x 2 root root 4096 Aug 18 23:29 selinuxdrwxr-xr-x 14 root root 4096 Aug 18 23:31 usrdrwxr-xr-x 3 root root 4096 Aug 18 23:41 tftpbootdrwxr-xr-x 13 root root 12288 Aug 18 23:52 libdrwxr-xr-x 3 root root 4096 Aug 18 23:52 bootdrwxr-xr-x 26 root root 4096 Aug 18 23:54 vardrwxr-xr-x 2 root root 4096 Aug 18 23:59 bindrwxr-xr-x 2 root root 12288 Aug 18 23:59 sbindrwxr-xr-x 3 root root 4096 Aug 19 00:01 homedrwxr-xr-x 3 root root 4096 Aug 19 00:02 u01drwxr-x--- 14 root root 4096 Aug 19 00:09 rootdr-xr-xr-x 106 root root 0 Aug 19 21:49 procdrwxr-xr-x 11 root root 0 Aug 19 21:49 sysdrwxr-xr-x 115 root root 12288 Aug 19 21:50 etcdrwxr-xr-x 2 root root 0 Aug 19 21:50 miscdrwxr-xr-x 2 root root 0 Aug 19 21:50 netdrwxrwxrwt 9 root root 4096 Aug 19 21:50 tmpdrwxr-xr-x 11 root root 3600 Aug 19 21:50 dev[root@inam /]# pwd/[root@inam /]# cd /u01[root@inam u01]# lltotal 16drwx------ 2 root root 16384 Aug 18 23:28 lost+found[root@inam u01]# ls -lrttotal 16drwx------ 2 root root 16384 Aug 18 23:28 lost+found[root@inam u01]# mkdir test[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:39 test[root@inam u01]# cd test[root@inam test]# ls -lrttotal 0[root@inam test]# pwd/u01/test[root@inam test]# cd ..[root@inam u01]# pwd/u01[root@inam u01]# cd /u01/test[root@inam test]# cd ../..[root@inam /]# pwd/[root@inam /]# cd -/u01/test[root@inam test]# pwd/u01/test[root@inam test]# cd[root@inam ~]# pwd/root[root@inam ~]# cd /[root@inam /]# ls -lrttotal 172drwxr-xr-x 2 root root 4096 Feb 17 2010 srvdrwxr-xr-x 2 root root 4096 Feb 17 2010 optdrwxr-xr-x 2 root root 4096 Feb 17 2010 mntdrwxr-xr-x 2 root root 4096 Feb 17 2010 mediadrwx------ 2 root root 16384 Aug 18 23:27 lost+founddrwxr-xr-x 2 root root 4096 Aug 18 23:29 selinuxdrwxr-xr-x 14 root root 4096 Aug 18 23:31 usrdrwxr-xr-x 3 root root 4096 Aug 18 23:41 tftpbootdrwxr-xr-x 13 root root 12288 Aug 18 23:52 libdrwxr-xr-x 3 root root 4096 Aug 18 23:52 bootdrwxr-xr-x 26 root root 4096 Aug 18 23:54 vardrwxr-xr-x 2 root root 4096 Aug 18 23:59 bindrwxr-xr-x 2 root root 12288 Aug 18 23:59 sbindrwxr-xr-x 3 root root 4096 Aug 19 00:01 homedrwxr-x--- 14 root root 4096 Aug 19 00:09 rootdr-xr-xr-x 106 root root 0 Aug 19 21:49 procdrwxr-xr-x 11 root root 0 Aug 19 21:49 sysdrwxr-xr-x 115 root root 12288 Aug 19 21:50 etcdrwxr-xr-x 2 root root 0 Aug 19 21:50 miscdrwxr-xr-x 2 root root 0 Aug 19 21:50 netdrwxrwxrwt 9 root root 4096 Aug 19 21:50 tmpdrwxr-xr-x 11 root root 3600 Aug 19 21:50 devdrwxr-xr-x 4 root root 4096 Aug 19 22:39 u01[root@inam /]# cd /u01/test[root@inam test]# cd /[root@inam /]# cd[root@inam ~]# pwd/root[root@inam ~]# home location of root user[root@inam ~]# cd /u01[root@inam u01]# cd[root@inam ~]# cd /u01/test[root@inam test]# cd /u01[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:39 test[root@inam u01]# lslost+found test[root@inam u01]# lltotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:39 test[root@inam u01]# pwd/u01[root@inam u01]# mkdir /root/dev[root@inam u01]# lltotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:39 test[root@inam u01]# ll /roottotal 80-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:39 test[root@inam u01]# rmdir test[root@inam u01]# ls -lrtotal 16drwx------ 2 root root 16384 Aug 18 23:28 lost+found[root@inam u01]# mkdir abc[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:45 abc[root@inam u01]# cd abc/[root@inam abc]# touch xyz.txt[root@inam abc]# ls -lrttotal 0-rw-r--r-- 1 root root 0 Aug 19 22:45 xyz.txt[root@inam abc]# pwd/u01/abc[root@inam abc]# cd ..[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:45 abc[root@inam u01]# rmdir abc/rmdir: abc/: Directory not empty[root@inam u01]# rm -r abc/rm: descend into directory `abc/'? n[root@inam u01]# cd abc/[root@inam abc]# ls -lrttotal 0-rw-r--r-- 1 root root 0 Aug 19 22:45 xyz.txt[root@inam abc]# cd ..[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:45 abc[root@inam u01]# rm -rf abc/[root@inam u01]# very dangerous command-bash: very: command not found[root@inam u01]# mkdir hgr[root@inam u01]# cd hgr[root@inam hgr]# touch abb.txt[root@inam hgr]# ls -lrttotal 0-rw-r--r-- 1 root root 0 Aug 19 22:50 abb.txt[root@inam hgr]# pwd/u01/hgr[root@inam hgr]# cd ..[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:50 hgr[root@inam u01]# ls -lrt hgr/total 0-rw-r--r-- 1 root root 0 Aug 19 22:50 abb.txt[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 2 root root 4096 Aug 19 22:50 hgr[root@inam u01]# rm -rf hgr/[root@inam u01]# cd /[root@inam /]# ls -lrttotal 172drwxr-xr-x 2 root root 4096 Feb 17 2010 srvdrwxr-xr-x 2 root root 4096 Feb 17 2010 optdrwxr-xr-x 2 root root 4096 Feb 17 2010 mntdrwxr-xr-x 2 root root 4096 Feb 17 2010 mediadrwx------ 2 root root 16384 Aug 18 23:27 lost+founddrwxr-xr-x 2 root root 4096 Aug 18 23:29 selinuxdrwxr-xr-x 14 root root 4096 Aug 18 23:31 usrdrwxr-xr-x 3 root root 4096 Aug 18 23:41 tftpbootdrwxr-xr-x 13 root root 12288 Aug 18 23:52 libdrwxr-xr-x 3 root root 4096 Aug 18 23:52 bootdrwxr-xr-x 26 root root 4096 Aug 18 23:54 vardrwxr-xr-x 2 root root 4096 Aug 18 23:59 bindrwxr-xr-x 2 root root 12288 Aug 18 23:59 sbindrwxr-xr-x 3 root root 4096 Aug 19 00:01 homedr-xr-xr-x 106 root root 0 Aug 19 21:49 procdrwxr-xr-x 11 root root 0 Aug 19 21:49 sysdrwxr-xr-x 115 root root 12288 Aug 19 21:50 etcdrwxr-xr-x 2 root root 0 Aug 19 21:50 miscdrwxr-xr-x 2 root root 0 Aug 19 21:50 netdrwxrwxrwt 9 root root 4096 Aug 19 21:50 tmpdrwxr-xr-x 11 root root 3600 Aug 19 21:50 devdrwxr-x--- 15 root root 4096 Aug 19 22:44 rootdrwxr-xr-x 3 root root 4096 Aug 19 22:51 u01[root@inam /]# cd[root@inam ~]# pwd/root[root@inam ~]# mkdir /u01/sony/LGmkdir: cannot create directory `/u01/sony/LG': No such file or directory[root@inam ~]# mkdir -p /u01/sony/LG[root@inam ~]# mkdir -p /u01/test/dev/tgr[root@inam ~]# cd /u01[root@inam u01]# ls -lrttotal 24drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 3 root root 4096 Aug 19 22:54 sonydrwxr-xr-x 3 root root 4096 Aug 19 22:54 test[root@inam u01]# cd test[root@inam test]# ls -ltrtotal 4drwxr-xr-x 3 root root 4096 Aug 19 22:54 dev[root@inam test]# cd dev/[root@inam dev]# ls -lrttotal 4drwxr-xr-x 2 root root 4096 Aug 19 22:54 tgr[root@inam dev]# cd /u01[root@inam u01]# ls -lrttotal 24drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 3 root root 4096 Aug 19 22:54 sonydrwxr-xr-x 3 root root 4096 Aug 19 22:54 test[root@inam u01]# rmdir testrmdir: test: Directory not empty[root@inam u01]# ls -lrt test/total 4drwxr-xr-x 3 root root 4096 Aug 19 22:54 devYou have mail in /var/spool/mail/root[root@inam u01]# ls -lrt test/dev/total 4drwxr-xr-x 2 root root 4096 Aug 19 22:54 tgr[root@inam u01]# ls -lrt test/dev/tgr/total 0[root@inam u01]# ls -lrttotal 24drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 3 root root 4096 Aug 19 22:54 sonydrwxr-xr-x 3 root root 4096 Aug 19 22:54 test[root@inam u01]# pwd/u01[root@inam u01]# rm -rf test/[root@inam u01]# ls -lrttotal 20drwx------ 2 root root 16384 Aug 18 23:28 lost+founddrwxr-xr-x 3 root root 4096 Aug 19 22:54 sony[root@inam u01]# cd ~[root@inam ~]# pwd/root[root@inam ~]# cd /u01/sony/LG/[root@inam LG]# cd -/root[root@inam ~]# man cd[root@inam ~]# man mkdir[root@inam ~]#[root@inam ~]#[root@inam ~]# cat > tac.txtthis is a new filei am showing some demo[root@inam ~]# ls -lrttotal 84-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 42 Aug 19 23:02 tac.txt[root@inam ~]#[root@inam ~]# cat tac.txtthis is a new filei am showing some demo[root@inam ~]#[root@inam ~]# cat >> tac.txtthis is extra linei am appending it[root@inam ~]#[root@inam ~]# cat tac.txtthis is a new filei am showing some demothis is extra linei am appending it[root@inam ~]# cat > tac.txtthis is another extra line[root@inam ~]#[root@inam ~]# cat tac.txtthis is another extra line[root@inam ~]# cat >> tac.txtthis is 3rd[root@inam ~]# cat tac.txtthis is another extra linethis is 3rd[root@inam ~]# cat tac.txt > new.txt[root@inam ~]# cat new.txtthis is another extra linethis is 3rd[root@inam ~]# cat tac.txt new.txt > agg.txt[root@inam ~]#[root@inam ~]# cat agg.txtthis is another extra linethis is 3rdthis is another extra linethis is 3rd[root@inam ~]# cat > myfile.txtthis is something new[root@inam ~]#[root@inam ~]# cat myfile.txt >> agg.txt[root@inam ~]#[root@inam ~]# cat agg.txtthis is another extra linethis is 3rdthis is another extra linethis is 3rdthis is something new[root@inam ~]# cat myfile.txt agg.txt > abcd.txt[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt[root@inam ~]# cat abcd.txtthis is something newthis is another extra linethis is 3rdthis is another extra linethis is 3rdthis is something new[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt[root@inam ~]#[root@inam ~]#[root@inam ~]# touch hrd.txt[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:11 hrd.txt[root@inam ~]# cat hrd.txt[root@inam ~]# touch is used to create empty files[root@inam ~]#[root@inam ~]# touch abf her hjw opp[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:11 hrd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 hjw-rw-r--r-- 1 root root 0 Aug 19 23:12 her-rw-r--r-- 1 root root 0 Aug 19 23:12 abf[root@inam ~]# rm abfrm: remove regular empty file `abf'? y[root@inam ~]# rm -f hjw[root@inam ~]# rm -f hrd.txt[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 her[root@inam ~]# cp abcd.txt /u01/sony/[root@inam ~]# cd /u01/sony/[root@inam sony]# ls -lrttotal 8drwxr-xr-x 2 root root 4096 Aug 19 22:54 LG-rw-r--r-- 1 root root 122 Aug 19 23:14 abcd.txt[root@inam sony]# cd -/root[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 her[root@inam ~]# ls -lrt *.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt[root@inam ~]# cp *.txt /u01/sony/cp: overwrite `/u01/sony/abcd.txt'? y[root@inam ~]# cd /u01/sony/[root@inam sony]# ls -lrttotal 24drwxr-xr-x 2 root root 4096 Aug 19 22:54 LG-rw-r--r-- 1 root root 39 Aug 19 23:15 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:15 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:15 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:15 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:15 abcd.txt[root@inam sony]# cd[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktopdrwxr-xr-x 2 root root 4096 Aug 19 22:44 dev-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 her[root@inam ~]# cd dev/[root@inam dev]# ls[root@inam dev]# cp ../*.txt .[root@inam dev]# ls -lrttotal 20-rw-r--r-- 1 root root 39 Aug 19 23:17 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:17 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:17 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:17 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:17 abcd.txt[root@inam dev]# cd ..[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktop-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 herdrwxr-xr-x 2 root root 4096 Aug 19 23:17 dev[root@inam ~]# cp dev/ /u01/sony/cp: omitting directory `dev/'[root@inam ~]# ls -lrt /u01/sony/total 24drwxr-xr-x 2 root root 4096 Aug 19 22:54 LG-rw-r--r-- 1 root root 39 Aug 19 23:15 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:15 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:15 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:15 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:15 abcd.txt[root@inam ~]# ls -lrttotal 100-rw-r--r-- 1 root root 5385 Aug 19 00:01 install.log.syslog-rw-r--r-- 1 root root 47071 Aug 19 00:01 install.log-rw------- 1 root root 3244 Aug 19 00:02 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 Aug 19 00:08 Desktop-rw-r--r-- 1 root root 39 Aug 19 23:05 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:05 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:06 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:07 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:09 abcd.txt-rw-r--r-- 1 root root 0 Aug 19 23:12 opp-rw-r--r-- 1 root root 0 Aug 19 23:12 herdrwxr-xr-x 2 root root 4096 Aug 19 23:17 dev[root@inam ~]# cp -r dev/ /u01/sony/[root@inam ~]# cd /u01/sony/[root@inam sony]# ls -lrttotal 28drwxr-xr-x 2 root root 4096 Aug 19 22:54 LG-rw-r--r-- 1 root root 39 Aug 19 23:15 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:15 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:15 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:15 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:15 abcd.txtdrwxr-xr-x 2 root root 4096 Aug 19 23:18 dev[root@inam sony]# cd dev/[root@inam dev]# lsabcd.txt agg.txt myfile.txt new.txt tac.txt[root@inam dev]# ls -lrttotal 20-rw-r--r-- 1 root root 39 Aug 19 23:18 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:18 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:18 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:18 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:18 abcd.txt[root@inam dev]# cp abcd.txt jhgf.txt[root@inam dev]# ls -lrttotal 24-rw-r--r-- 1 root root 39 Aug 19 23:18 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:18 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:18 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:18 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:18 abcd.txt-rw-r--r-- 1 root root 122 Aug 19 23:19 jhgf.txt[root@inam dev]# cat abcd.txtthis is something newthis is another extra linethis is 3rdthis is another extra linethis is 3rdthis is something new[root@inam dev]#[root@inam dev]#[root@inam dev]# cat jhgf.txtthis is something newthis is another extra linethis is 3rdthis is another extra linethis is 3rdthis is something new[root@inam dev]# cp abcd.txt jhgf.txtcp: overwrite `jhgf.txt'? y[root@inam dev]# ls -lrttotal 24-rw-r--r-- 1 root root 39 Aug 19 23:18 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:18 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:18 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:18 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:18 abcd.txt-rw-r--r-- 1 root root 122 Aug 19 23:20 jhgf.txt[root@inam dev]# mv jhgf.txt ipp.txt[root@inam dev]# ls -lrttotal 24-rw-r--r-- 1 root root 39 Aug 19 23:18 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:18 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:18 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:18 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:18 abcd.txt-rw-r--r-- 1 root root 122 Aug 19 23:20 ipp.txt[root@inam dev]# pwd/u01/sony/dev[root@inam dev]# mv ipp.txt /u01/sony/LG/[root@inam dev]# ls -lrttotal 20-rw-r--r-- 1 root root 39 Aug 19 23:18 tac.txt-rw-r--r-- 1 root root 39 Aug 19 23:18 new.txt-rw-r--r-- 1 root root 22 Aug 19 23:18 myfile.txt-rw-r--r-- 1 root root 100 Aug 19 23:18 agg.txt-rw-r--r-- 1 root root 122 Aug 19 23:18 abcd.txt[root@inam dev]# cd /u01/sony/LG/[root@inam LG]# ls -lrttotal 4-rw-r--r-- 1 root root 122 Aug 19 23:20 ipp.txt[root@inam LG]# ls -lrttotal 4-rw-r--r-- 1 root root 122 Aug 19 23:20 ipp.txt[root@inam LG]# cat ipp.txtthis is something newthis is another extra linethis is 3rdthis is another extra linethis is 3rdthis is something new[root@inam LG]#[root@inam LG]#[root@inam LG]# vi ipp.txt[root@inam LG]# vi ipp.txt[root@inam LG]# vi ipp.txt[root@inam LG]# vi ipp.txt[root@inam LG]# vi ipp.txt[root@inam LG]# vi ipp.txt[root@inam LG]# ls -lrttotal 4-rw-r--r-- 1 root root 923 Aug 19 23:47 ipp.txt[root@inam LG]# chmod 754 ipp.txt[root@inam LG]# ls -lrttotal 4-rwxr-xr-- 1 root root 923 Aug 19 23:47 ipp.txt[root@inam LG]# chown oracle:dba ipp.txt[root@inam LG]# ls -lrttotal 4-rwxr-xr-- 1 oracle dba 923 Aug 19 23:47 ipp.txt[root@inam LG]#[root@inam LG]# groupadd tennis[root@inam LG]# groupadd cricket[root@inam LG]#[root@inam LG]# useradd -g tennis -G cricket tom[root@inam LG]#[root@inam LG]# id tomuid=54322(tom) gid=54323(tennis) groups=54323(tennis),54324(cricket)[root@inam LG]# ls -lrttotal 4-rwxr-xr-- 1 oracle dba 923 Aug 19 23:47 ipp.txt[root@inam LG]# chown tom:tennis ipp.txt[root@inam LG]# ls -lrttotal 4-rwxr-xr-- 1 tom tennis 923 Aug 19 23:47 ipp.txt[root@inam LG]# useradd -g cricket harry[root@inam LG]# ls -lrttotal 4-rwxr-xr-- 1 tom tennis 923 Aug 19 23:47 ipp.txt[root@inam LG]# passwd harryChanging password for user harry.New UNIX password:BAD PASSWORD: it is based on a dictionary wordRetype new UNIX password:passwd: all authentication tokens updated successfully.[root@inam LG]# pwd/u01/sony/LG[root@inam LG]# su - harry[harry@inam ~]$ cat /u01/sony/LG/ipp.txthrew that way you can add new content texthrew that way you can add new content texthrew that is third time texthrew that is another line texthrew that way you can add new content texthrew that way you can add new content texthrew that way you can add new content texthrew i am writing using vi editor texthrew that is something new texthrew i am writing using vi editor texthrew i am writing using vi editor texthrew that is something new texthrew i am writing using vi editor texthrew that is something new texthrew that is another extra line texthrew that is 3rd texthrew that is 3rd texthrew that is another extra line texthrew that is 3rd texthrew that is something new texthrew that is another extra line texthrew ------------------------------- texthrew that is 3rd texthrew that is something new texthrew that is another extra line texthrew that is 3rd texthrew that is something new text[harry@inam ~]$ ls -lrt /u01/sony/LGtotal 4-rwxr-xr-- 1 tom tennis 923 Aug 19 23:47 ipp.txt[harry@inam ~]$ vi /u01/sony/LG/ipp.txt[harry@inam ~]$