Linux 命令速记本

# 比较1.txt和2.txt的差异
comm [-1-2-3] 1.txt 2.txt
# 求1.txt和2.txt的MD5用于区分两个文件是否相同 md5sum
1.txt 2.txt #tr 用于转换或删除文件中的字符。 comm -3 1.txt 2.txt | tr -d ' '

# 查找某文件下是否包含某些字符
 grep -rn 'location' ./

# 删除掉过期文件
find /data/path/ -mtime +5 | xargs rm -rf

# 删除、添加、查看目录
popd pushd dirs

# 服务路由查看
traceroute mtr

# linux启动socket
nc -lk 8888
原文地址:https://www.cnblogs.com/zyh1994/p/11263911.html