linux命令点滴

来源:互联网 发布:英国约克大学 知乎 编辑:程序博客网 时间:2024/06/06 00:14

Where there is a shell, there is a way!


shell>find -maxdepth 1 -type f -newermt "00:00" -printf "%f\n" | sort 查看今天创建的文件

shell>history | awk '{print $2}' | sort | uniq -c | sort -rn | head 列出你最常使用的命令

(这儿还有另一个出处:history | awk '{CMD[$2]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10)

shell>function whichpkg { dpkg -S $1 | egrep -w $(which $1)$; } 寻找命令属于哪个包

(这里我一般三部曲: 1:shell>which 命令; 2: shell>rpm -ql 目录; 3: shell> grep "conf"等,看对应命令的一些配置文件,或bin目录下的其他命令... )

shell>rsync -vau --exclude='.*' SOURCE-PATH/myfold TARGET-PATH    snyc同步时候忽略隐藏文件

shell>python -mjson.tool somejson.txt    //从python2.6开始,多了个json.tool的东西.
//修改rhel6时区:
shell>alias cp='cp'
shell>echo 'ZONE="Asia/Shanghai"' > /etc/sysconfig/clock
shell>cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
shell>ntpdate stdtime.gov.hk > /dev/null
Then, U can date!


http://commandlinefu.cn/

http://www.commandlinefu.com/




PS: 好久没有把这些滴滴点点记下了 ...奋斗...

0 0
原创粉丝点击