Linux 服务器开发常用命令操作

1)查看网络端口 netstat -na --ip

2)查看特定应用程序进程 ps -ef | grep vsftp  or ps aux | grep xxx.exe

3)查看系统日志 vi /etc/var/syslog

4)ubuntu完全卸载并删除配置文件 apt-get --purge remove vsftpd  apt-get update apt-get install vsftpd

5)查看某一端口运行的网络程序netstat -ntpl 22      

6)查看某一端口运行的程序lsof -i:22

7)查看进程运行的程序目录 ll /proc/pid  exmaple: ll /proc/4403

8)列举Linux下所有用户 cat /etc/passwd |cut -f 1 -d:

9)跨服务器copy scp xxx.file root@192.168.22.123:/root/

10)实时查看日志 tail -n -100 -f exe.log | grep key -A 10 -B 10

11)抓包 tcpdump -w test.pcap -i eth0

12)显示文件内容 cat file.log | grep keyword

13)解压文件并copy tar  zxvf xx.tar.gz -C /usr/local/setup/

14)删除文件和目录 rm -rf /root/test/dir

15)gdb调试正在运行的进程 gdb attach pid  continue/c 

16)find命令查找特定文件并copy到指定目录 find /root/testdir/ -name "*.so*" -exec cp {} libs/ ;

17)强制杀掉进程 kill -9 pid

18)查看系统环境变量env

19)查看各分区使用情况 df -h

20)查看防火墙设置 iptables -L

原文地址:https://www.cnblogs.com/Forever-Kenlen-Ja/p/7819967.html