在.profile中加如下语句
alias lslog='ls -l $(cat ~/curr_logr_name.txt)|sort +5'
然后就可以直接进行lslog来查看了
另:
curr_logr_name.txt的实际内容如下
qry_db2$(/home/dsg)vi curr_logr_name.txt
"curr_logr_name.txt" 19 lines, 456 characters
/dsg/bill_1/log/log.r0
/dsg/bill_2/log/log.r0
/dsg/bill_2/log/log.r2
/dsg/bill_2/log/log.r3
/dsg/bill_2/log/log.r5
/dsg/bill_2/log/log.r6
/dsg/bill_2/log/log.r7
/dsg/bill_2/log/log.r8
/dsg/bill_3/log/log.r0
/dsg/bill_3/log/log.r1
/dsg/bill_3/log/log.r2
/dsg/bill_3/log/log.r3
/dsg/other/log/log.r0
/dsg/other/log/log.r1
/dsg/other/log/log.r2
/dsg/other/log/log.r3
/dsg/peizhi/log/log.r0
/dsg/stat/log/log.r0
/dsg/stat/log/log.r1
实际操作
qry_db2$(/home/dsg)lslog
-rw-r--r-- 1 dsg dba 2209 Oct 09 16:05 /dsg/bill_3/log/log.r2
-rw-r--r-- 1 dsg dba 32105 Oct 09 16:30 /dsg/stat/log/log.r1
-rw-r--r-- 1 dsg dba 3216 Oct 09 16:33 /dsg/peizhi/log/log.r0
-rw-r--r-- 1 dsg dba 2884 Oct 09 16:38 /dsg/bill_2/log/log.r0
-rw-r--r-- 1 dsg dba 278088 Oct 09 16:39 /dsg/stat/log/log.r0
-rw-r--r-- 1 dsg dba 497010 Oct 09 16:40 /dsg/bill_3/log/log.r1
-rwxrwxrwx 1 dsg dba 331815 Oct 09 16:41 /dsg/bill_1/log/log.r0
-rw-r--r-- 1 dsg dba 52270 Oct 09 16:41 /dsg/bill_2/log/log.r2
-rw-r--r-- 1 dsg dba 52652 Oct 09 16:41 /dsg/bill_2/log/log.r3
-rw-r--r-- 1 dsg dba 52419 Oct 09 16:41 /dsg/bill_2/log/log.r5
-rw-r--r-- 1 dsg dba 37184 Oct 09 16:41 /dsg/bill_2/log/log.r6
-rw-r--r-- 1 dsg dba 37135 Oct 09 16:41 /dsg/bill_2/log/log.r7
-rw-r--r-- 1 dsg dba 46898 Oct 09 16:41 /dsg/bill_2/log/log.r8
-rw-r--r-- 1 dsg dba 675151 Oct 09 16:41 /dsg/bill_3/log/log.r0
-rw-r--r-- 1 dsg dba 658199 Oct 09 16:41 /dsg/bill_3/log/log.r3
-rw-r--r-- 1 dsg dba 96284 Oct 09 16:41 /dsg/other/log/log.r0
-rw-r--r-- 1 dsg dba 128179 Oct 09 16:41 /dsg/other/log/log.r1
-rw-r--r-- 1 dsg dba 140618 Oct 09 16:41 /dsg/other/log/log.r2
-rw-r--r-- 1 dsg dba 139080 Oct 09 16:41 /dsg/other/log/log.r3
不过我对那个SORT+5和CAT那个组合还是看不明白啊,请大家看懂的指导一下,谢谢!
此外还有
alias durmp='du -k /dsg/bill_1/rmp && du -k /dsg/bill_2/rmp && du -k /dsg/stat/rmp && du -k /dsg/other/rmp && du -k /dsg/bill_3/rmp'
alias dureal='cd /dsg;du -sm $(find . -name real[0-9]);cd -'
的写法,其中的&& ; cd - 都看不懂,感觉好怪异