netstat -antulp
# check appname and pid
sudo netstat -antulp
sudo ss -tulnp | grep 443
#下载设备中 root 目录下的 test.txt 到当前目录
scp root@192.168.0.111:/root/test.txt ./
#从设备下载 root 目录下的 demo 文件夹到当前目录
scp -r root@192.168.0.111:/root/demo ./
#上传当前目录下的 result.log 到设备 root 目录下
scp ./result.log root@192.168.0.111:/root/
#上传当前目录下的 check 目录到设备 root 目录
scp -r ./check root@192.168.0.111:/root/
# PermissionError: [Errno 13] Permission denied
sudo su
sudo su - postgres
sudo -i -u senthil
sudo adduser senthil
sudo usermod -g root song
sudo adduser senthil sudo
sudo usermod -aG sudo senthil
sudo deluser senthil
du -hx --max-depth=1 / | sort -h -r
https://www.cnblogs.com/z1990/p/15179901.html
https://www.cnblogs.com/peida/archive/2012/11/14/2769248.html
find . -type f -exec ls -l {} \;
find . -type f -mtime +14 -exec rm {} \;
find . -type d -name __pycache__ -exec rm -r {} \;
find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
find . -name "*.log" -mtime +5 -ok rm {} \;
find . -name "*.log" -exec mv {} .. \;
find . -name "*.log" -exec cp {} test3 \;
find /var/lib/docker/containers/ -name *-json.log
find ./ -size +10M -size -20M
find ~ -size -1G
rsync -avz /var/lib/docker /root/dockerlib/
grep nobody /etc/passwd
grep linuxtechi /etc/passwd /etc/shadow /etc/gshadow
# list all files
grep -l 'root' /etc/fstab /etc/passwd /etc/mtab
# display line number
grep -n 'nobody' /etc/passwd
# find string with prefix
grep ^backup /etc/passwd
# find string with suffix
grep bash$ /etc/passwd
# find recursively
sudo grep -r nobody /etc
# find empty line
grep '^$' /etc/sysctl.conf
# ignore lettercase
grep -i IP_Forward /etc/sysctl.conf
# find with one word
sudo sysctl -a | grep -w 'vm.swappiness'
# find with multiple words
grep -e nobody -e mail /etc/passwd
grep -E "nobody|mail" /etc/passwd