linux第二次

[root@localhost ~]# find / -name lib -print >> test
[root@localhost ~]# ls
dos      hello.c  test
[root@localhost ~]# head test
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# tail test
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# more test
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# more test
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# cat test
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# wc -l test
6 test
[root@localhost ~]# ls -l test
-rw-r--r--    1 root     root           105 Dec 22 20:35 test
[root@localhost ~]# chmod o+w test
[root@localhost ~]# cp test /root/dos
[root@localhost ~]# cd /
[root@localhost ]# pwd
/
[root@localhost ]# cd /root
[root@localhost ~]# ls
dos      hello.c  test
[root@localhost ~]# ln -s test testsymbol
[root@localhost ~]# ln test testhard
[root@localhost ~]# ls -l test
-rw-r--rw-    2 root     root           105 Dec 22 20:35 test
[root@localhost ~]# ls -l testsymbol
lrwxrwxrwx    1 root     root             4 Dec 22 20:41 testsymbol -> test
[root@localhost ~]# ls -l testhard
-rw-r--rw-    2 root     root           105 Dec 22 20:35 testhard
[root@localhost ~]# ls -il testhard
  11587 -rw-r--rw-    2 root     root           105 Dec 22 20:35 testhard
[root@localhost ~]# rm testsymbol
[root@localhost ~]# ls
dos       hello.c   test      testhard
[root@localhost ~]# ls -l test
-rw-r--rw-    2 root     root           105 Dec 22 20:35 test
[root@localhost ~]# rm testhard
[root@localhost ~]# ls -l test
-rw-r--rw-    1 root     root           105 Dec 22 20:35 test
[root@localhost ~]# ln -s test testsymbol
[root@localhost ~]# ln test testhard
[root@localhost ~]# ls
dos         hello.c     test        testhard    testsymbol
[root@localhost ~]# rm test
[root@localhost ~]# cat testsymbol
cat: can't open 'testsymbol': No such file or directory
[root@localhost ~]# cat testhard
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib
[root@localhost ~]# ls
dos         hello.c     testhard    testsymbol
[root@localhost ~]# mkdir test
[root@localhost ~]# ls
dos         hello.c     test        testhard    testsymbol
[root@localhost ~]# cat testsybol
cat: can't open 'testsybol': No such file or directory
[root@localhost ~]# cat testsymbol
cat: read error: Is a directory
[root@localhost ~]# cat testhard
/var/lib
/lib
/usr/local/lib
/usr/lib
/usr/lib/perl5/5.22.2/unicore/lib
/usr/share/gdb/auto-load/usr/lib

你可能感兴趣的:(linux)