1.PS1提示符:
1 2 |
unix:export PS1="[$LOGNAME@`hostname` $PWD$]" linux:export PS1='[\u@\h \W]\$' |
2.tar多个文件到一个tar包
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
D:\oracle>ls -l total 0 drwxrwxrwx 1 Administrator None 0 Jun 16 19:56 admin drwxrwxrwx 1 Administrator None 0 May 28 23:27 arch drwxrwxrwx 1 Administrator None 0 Feb 19 22:02 ctl_file drwxrwxrwx 1 Administrator None 0 Sep 17 2006 ora92 drwxrwxrwx 1 Administrator None 0 Jun 21 10:43 ora_test_1 drwxrwxrwx 1 Administrator None 0 Jun 21 10:43 ora_test_2 drwxrwxrwx 1 Administrator None 0 Jun 21 10:43 ora_test_3 -rwxrwxrwa 1 Administrator None 0 Jun 21 10:42 ora_testfile.txt drwxrwxrwx 1 Administrator None 0 Jun 9 18:02 oradata 假如需要这些做tar包: ora_test_1 ora_test_2 ora_test_3 ora_testfile.txt D:\oracle>tar cf 111.tar ora_test_1 ora_test_2 ora_test_3 ora_testfile.txt D:\oracle>ls 111.tar arch ora92 ora_test_2 ora_testfile.txt admin ctl_file ora_test_1 ora_test_3 oradata |
3.查找ftpTmp下是否存在文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
report@my_testdb:/wapfile/Datafile$ ll total 608 drwxr-xr-x 7 report users 8192 Mar 15 05:22 aaa drwxr-xr-x 2 report users 16384 Jul 20 00:29 bbb drwxr-xr-x 18 report users 8192 Mar 30 18:18 ccc drwxr-xr-x 7 report users 8192 Mar 15 05:22 ddd drwxr-xr-x 7 report users 8192 Mar 15 05:22 eee drwxr-xr-x 8 report users 8192 Mar 15 05:22 fff drwxr-xr-x 8 report users 8192 Mar 15 05:22 ggg drwxr-xr-x 17 report users 8192 Jun 22 21:50 hhh drwxr-xr-x 16 report users 8192 Jun 22 21:49 iii 需要查找下面所有的路径下的ftpTmp路径下是否存在文件,可以用以下脚本: for loop in `ls ` do echo ${loop} >> temp.txt ll ${loop}/ftpTmp >> temp.txt done |
4.批量删除文件
1 2 3 4 5 6 7 |
find ./ -size 0 -exec rm {} \; 删除0字节大小的文件 find ./ -ctime +10 -exec rm {} \; 删除改变时间为10天前的文件 注:ctime相关: atime: last file access time ctime: last status change time mtime: last data modify time |
5.无法识别@符号
核对.profile文件是否有如下行:
1 2 3 |
oracle@ha_dc01:/oracle > cat .profile # @(#)B.11.11_LR set -u |