Open anancds opened 4 years ago
find . -name "*.txt" -type d
find . -name "*.txt" -type f -mtime -1
find . -name "*.txt" -type f -mtime -1 | xargs rm -rf {} \;
find . -name "*.txt" -type f -mtime -1 -exec cp {} /tmp/ \;
find . -name "*.txt" -type f -mtime -30 -size -19k
find . -name "*.txt" -type f -mtime -30 -size -19k -perm 644 -exec chmod -R 755 {} \;
grep -n --color "root" /etc/passwd
grep -v "#" nginx.conf | grep -v "^$"
awk '{print $1}' test.txt
awk '{print $NF}' test.txt
awk -F: '{print $1,$NF}' test.txt
双引号在awk里面表示添加的意思
awk -F: '{print $1"test"$NF}' test.txt
ifconfig | grep "127" | awk '{print $2}' | awk -F. '{print $1"-"$2"-"$3"-"$4}'
find . -name "*.txt" -type f -mtime -30 -size -19k -perm 644