Some command.

来源:互联网 发布:杰克奥特曼玩具淘宝 编辑:程序博客网 时间:2024/05/16 01:14

grep  -I  abc *

 

echo –e”/n123”   -e  

-e     enable interpretation of backslash escapes

 

diff –s –I abc file1 file2

-I RE  --ignore-matching-lines=RE

              Ignore changes whose lines all match RE.

-s  --report-identical-files

              Report when two files are the same.

 

-s file  The file size is not 0

-d file   The file is directory

-f file    The file is normal file,not directory

 

命令的条件执行

&& 如果第一条命令执行成功,就执行后面的命令

|| 如果第一条命令执行失败,则后面命令也要执行

[[ -s ${curr_Msg%.*}.dec ]] && [[ -s ${curr_Msg%.*}.dec.latest ]] && diff ${curr_Msg%.*}.dec ${curr_Msg%.*}.dec.latest >${curr_Msg%.*}.dec.latest.diff

 

cc prog.c >& err || mail bob <err

 

linux文件打包

 

把整个文件夹 folderTared 的内容打包成一个gz文件:
tar czvf folderTared.tar.gz /theDir/folderTared
把压缩的gz文件恢复到指定目录下:
tar xzvf folderTared.tar.gz /theDir/

 

 

uname -a

HP-UX csdc-097 B.11.11 U 9000/785 2013254652 unlimited-user license

原创粉丝点击