@mSolo
        
        2015-05-20T05:17:16.000000Z
        字数 1652
        阅读 1351
    Linux Vim
export CDPATH=.:~:/etc:/varalias cd4="cd ../../../.."function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
# grep John /etc/passwdjsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bashjdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash# grep -v John /etc/passwdjbourne:x:1084:1084:Jason Bourne:/home/jbourne:/bin/bash# grep -c John /etc/passwd2# grep -cv John /etc/passwd39# grep -i john /etc/passwdjsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bashjdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash# grep -ri john /home/users/home/users/subdir1/letter.txt:John, Thanks for your contribution./home/users/name_list.txt:John Smith/home/users/name_list.txt:John Doe
$ grep "^Nov 10" messages.1Nov 10 01:12:55 gs123 ntpd[2241]: time reset +0.177479 sNov 10 01:17:17 gs123 ntpd[2241]: synchronized to LOCAL(0), stratum 10
# find /etc -name "*mail*"# find / -type f -size +100M# find . -mtime +60 # 60 day# find /home/jsmith -type f -mtime +60 | xargs tar -cvf /tmp/`date '+%d%m%Y'_archive.tar`
$ cat employee.txt100 Jason Smith200 John Doe300 Sanjay Gupta400 Ashok Sharma$ cat bonus.txt100 $5,000200 $500300 $3,000400 $1,250$ join employee.txt bonus.txt100 Jason Smith $5,000200 John Doe $500300 Sanjay Gupta $3,000400 Ashok Sharma $1,250
find ~ -name ‘*.log’ -print0 | xargs -0 rm -f
Execute Commands in the Background with logout 
$ nohup ./my-shell-script.sh &
输出到屏幕的同时也输出到文件 
$ cat Example.txt |tee e2.txt 
$ script -a example.txt、$ exit
/\%>12l\%<24lsearch,来源600000 浦发银行:1,$s/\(\d\+\)\(\D\+\)/\1/g000042 中证财通可持续发展100指数 : 1,$s/\(^.\{6\}\).*/\1/g