在.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
ls -l $(cat ~/curr_logr_name.txt)|sort +5
cat 就没有什么好说了吧,读文件取结果给ls -l用
| sort +5 按照第6个field 排序,就是你的那个"Oct" field
echo "alias a=\"sqlplus '/as sysdba'\"" >> .bash_profile
以后登录oracle用户以后,只需敲一个a 再敲一下回车,就以sys用户连接到数据库了
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13165828/viewspace-611171/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13165828/viewspace-611171/