文件里面只取文件部分的是怎么做的?
比如文件a.txt
drwx------ 5 postfix postfix 4096 Sep 26 2006 0769-lawyer.com
drwx------ 4 postfix postfix 4096 Dec 16 2006 0769hc.com
drwx------ 4 postfix postfix 4096 Sep 28 2006 216666.com
drwx------ 3 postfix postfix 4096 Nov 30 2006 26355345.com
drwx------ 3 postfix postfix 4096 Sep 5 2006 310ben.com
drwx------ 6 postfix postfix 4096 Dec 26 2006 3hotel.cn
我只要后面的域名,前面的都去掉
[baidu@localhost]# awk '{print $9}' a.txt >aa.txt
比如文件a.txt
drwx------ 5 postfix postfix 4096 Sep 26 2006 0769-lawyer.com
drwx------ 4 postfix postfix 4096 Dec 16 2006 0769hc.com
drwx------ 4 postfix postfix 4096 Sep 28 2006 216666.com
drwx------ 3 postfix postfix 4096 Nov 30 2006 26355345.com
drwx------ 3 postfix postfix 4096 Sep 5 2006 310ben.com
drwx------ 6 postfix postfix 4096 Dec 26 2006 3hotel.cn
我只要后面的域名,前面的都去掉
[baidu@localhost]# awk '{print $9}' a.txt >aa.txt
[baidu@localhost]# vim aa.txt
0769-lawyer.com
0769hc.com
216666.com
26355345.com
310ben.com
3hotel.cn
0769hc.com
216666.com
26355345.com
310ben.com
3hotel.cn
linux下让以前使用的命令能使用上下方向键显示
编辑以下文件
/etc/profile
HISTSIZE=0
/etc/profile
HISTSIZE=0
设置为0表示不显示,你可以设置成100,只保存100条以前输入的命令记录
Ctrl+Enter 发布
发布
取消