假设有如下几个文件:
[root@bogon Desktop]# ls -l 总计 4 -rw-r--r-- 1 root root 0 02-07 10:21 a -r-x-w--w- 1 root root 0 02-07 10:22 b -rw-rw-rw- 1 root root 0 02-07 10:22 c -rwxrwxrwx 1 root root 638 2012-07-18 login.sql
[root@bogon Desktop]# chmod --reference a login.sql [root@bogon Desktop]# ls -l 总计 4 -rw-r--r-- 1 root root 0 02-07 10:21 a -r-x-w--w- 1 root root 0 02-07 10:22 b -rw-rw-rw- 1 root root 0 02-07 10:22 c -rw-r--r-- 1 root root 638 2012-07-18 login.sql
[root@bogon home]# ls -l 总计 24 drwx------ 7 oracle oinstall 4096 02-06 21:34 oracle drwx------ 3 oradev oinstall 4096 2012-07-15 oradev drwx------ 4 think think 4096 2012-07-23 think [root@bogon home]# chgrp --reference oracle think [root@bogon home]# ls -l 总计 24 drwx------ 7 oracle oinstall 4096 02-06 21:34 oracle drwx------ 3 oradev oinstall 4096 2012-07-15 oradev drwx------ 4 think oinstall 4096 2012-07-23 think
[root@bogon home]# ls -l 总计 24 drwx------ 7 oracle oinstall 4096 02-06 21:34 oracle drwx------ 3 oradev oinstall 4096 2012-07-15 oradev drwx------ 4 think oinstall 4096 2012-07-23 think [root@bogon home]# chown --reference oracle think [root@bogon home]# ls -l 总计 24 drwx------ 7 oracle oinstall 4096 02-06 21:34 oracle drwx------ 3 oradev oinstall 4096 2012-07-15 oradev
[oracle@Think ~]$ cd $ORACLE_HOME/bin [oracle@Think bin]$ stat oracle File: `oracle\' Size: 93362427 Blocks: 182552 IO Block: 4096 regular file Device: 802h/2050d Inode: 1557452 Links: 1 Access: (6751/-rwsr-s--x) Uid: ( 501/ oracle) Gid: ( 502/oinstall) Access: 2013-02-07 10:55:28.000000000 +0800 Modify: 2012-07-15 16:33:49.000000000 +0800 Change: 2012-07-15 16:36:54.000000000 +0800
[oracle@Think bin]$ stat -f oracle
File: "oracle"
ID: 0 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 2480156 Free: 769982 Available: 641965
Inodes: Total: 2560864 Free: 2394828[oracle@Think bin]$ stat sqlplus* File: `sqlplus\' Size: 8868 Blocks: 32 IO Block: 4096 regular file Device: 802h/2050d Inode: 1565800 Links: 1 Access: (0751/-rwxr-x--x) Uid: ( 501/ oracle) Gid: ( 502/oinstall) Access: 2013-02-07 10:14:38.000000000 +0800 Modify: 2012-07-15 16:34:00.000000000 +0800 Change: 2012-07-15 16:36:54.000000000 +0800 File: `sqlplusO\' Size: 0 Blocks: 8 IO Block: 4096 regular empty file Device: 802h/2050d Inode: 1560598 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 501/ oracle) Gid: ( 502/oinstall) Access: 2012-07-15 16:27:10.000000000 +0800 Modify: 2005-06-30 19:23:56.000000000 +0800 Change: 2012-07-15 16:36:54.000000000 +0800
[oracle@Think bdump]$ file alert_orcl.log
alert_orcl.log: ASCII English text
文件alert_orcl.log是一个ASCII文本文件,来看看更多的示例:
[oracle@Think dbs]$ file spfileorcl.ora.z
spfileorcl.ora.z: bzip2 compressed data, block size = 900k[oracle@Think dbs]$ file -z spfileorcl.ora.z spfileorcl.ora.z: POSIX tar archive (bzip2 compressed data, block size = 900k)
[root@Think Desktop]# file a_softlink a_softlink: symbolic link to `a\'
[root@Think Desktop]# file -L a_softlink a_softlink: ASCII text
[root@Think Desktop]# cat b My name is Think hello world [root@Think Desktop]# cat c Your name is Think hello world
[root@Think Desktop]# diff b c 1c1 < My name is Think --- > Your name is Think
[root@Think Desktop]# diff -y b c -W 120 My name is Think | Your name is Think hello world hello world
[root@Think Desktop]# diff -q b c Files b and c differ [root@Think Desktop]# diff b d [root@Think Desktop]#
[root@Think Desktop]# diff -u b c --- b 2013-02-07 17:23:54.000000000 +0800 +++ c 2013-02-07 17:24:32.000000000 +0800 @@ -1,2 +1,2 @@ -My name is Think +Your name is Think hello world
# sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
# export ORACLE_HOME=/u01/app/oracle/product/10.2/db2
# export PATH=$ORACLE_HOME/bin:$PATH
# sqlplus / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/catalog
...
等等。
[root@Think Desktop]# cmp b c b c differ: byte 1, line 1
[root@Think Desktop]# cmp -s b c [root@Think Desktop]# echo $? 1
# cmp sqlplus sqlplusO sqlplus sqlplusO differ:byte 657, line 7
# ls -l sqlplus* -rwxr-x--x 1 oracle dba 8851 Aug 4 05:15 sqlplus -rwxr-x--x 1 oracle dba 8851 Nov 2 2005 sqlplusO
[root@Think Desktop]# md5sum b 2f96b2388e690eaa463d2610954a9e05 b
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26515977/viewspace-1207990/ ,如需转载,请注明出处,否则将追究法律责任。