浏览与切换目录
ls -la
ls -lh
cd /var/www
cd -
pwd系统
文件、进程、权限、网络与远程运维常用命令。 — 共 16 条
共 16 条代码片段
ls -la
ls -lh
cd /var/www
cd -
pwdmkdir -p logs/app
cp -r src/ backup/
mv a.txt b.txt
rm -rf tmp/
rm -i important.txtfind . -name "*.log"
find /var/www -type f -mtime -7
find . -type d -name "node_modules"
find . -size +100Mgrep -rn "TODO" .
grep -i "error" app.log
grep -E "error|warn" app.log
tail -f app.log | grep --line-buffered errortar -czvf archive.tar.gz dir/
tar -xzvf archive.tar.gz
tar -tzvf archive.tar.gz
zip -r app.zip dist/
unzip app.zipps aux | grep nginx
top
htop
kill -9 <pid>
pkill -f "node src/index.js"lsof -i :3000
ss -lntp | grep 3000
netstat -lntp | grep 3000
kill -9 $(lsof -t -i:3000)nohup node app.js > app.log 2>&1 &
jobs
fg %1
Ctrl + Z # 挂起
bg %1chmod +x deploy.sh
chmod 755 script.sh
chmod -R 644 public/
chown -R www-data:www-data /var/www/appdf -h
du -sh *
du -h --max-depth=1
free -h
uptimesystemctl status nginx
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl enable nginx
journalctl -u nginx -fwhoami
id
sudo -i
sudo -u www-data bash
passwdcurl https://example.com
curl -I https://example.com
curl -X POST -H "Content-Type: application/json" \
-d '{"name":"vic"}' https://api.example.com/userssh user@host
ssh -p 22 user@host
scp ./file.txt user@host:/tmp/
scp -r ./dist user@host:/var/www/app/
rsync -avz ./dist/ user@host:/var/www/app/ping -c 4 example.com
dig example.com
nslookup example.com
ip a
traceroute example.comwget https://example.com/file.tar.gz
wget -O app.tar.gz https://example.com/file.tar.gz
curl -L -o app.tar.gz https://example.com/file.tar.gz