linux下网络开发常用命令合集
netstat
查看网络相关状态
nestat命令
常用命令
-r, --route 显示路由表
-i, --interfaces display interface table
-s, --statistics display networking statistics (like SNMP)结果会按各个协议进行统计
-v, --verbose 显示详细信息
-n, --numeric 不解析名称
--numeric-hosts 不解析主机名
--numeric-ports 忽略端口名称
--numeric-users 忽略用户名
-e, --extend 显示更多信息
-p, --programs display PID/Program name for sockets
-c, --continuous continuous listing 每隔一个固定时间,执行该netstat命令
-l, --listening display listening server sockets
-a, --all, --listening display all sockets (default: connected)
-o, --timers display timers -C, --cache display routing cache instead of FIB
tcpdump
根据使用者的定义对网络上的数据包进行截获的包分析工具。 tcpdump可以将网络中传送的数据包的“头”完全截获下来提供分析。
它支持针对网络层、协议、主机、网络或端口的过滤,并提供and、or、not等逻辑语句来帮助你去掉无用的信息。
tcpdump
ipcs
--------- 消息队列 -----------
键 msqid 拥有者 权限 已用字节数 消息
------------ 共享内存段 --------------
键 shmid 拥有者 权限 字节 连接数 状态
0x00000000 1245184 jcuan 600 524288 2 目标
0x00000000 1572865 jcuan 600 393216 2 目标
--------- 信号量数组 -----------
键 semid 拥有者 权限 nsems
0x510c02df 0 jcuan 600
ipcrm
删除消息队列、共享内存、信号灯
crontab
实现定时任务
xiyuan1999:linux定时任务的设置 crontab 配置指南
用户直接运行下边的任务编辑的是自己的crontab
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)
-i (prompt(提示) before deleting user's crontab)
/etc下边会有类似的一些相关文件
-rw-r--r-- 1 root root 401 12月 29 2014 anacrontab
drwxr-xr-x 2 root root 4096 3月 12 10:18 cron.d
drwxr-xr-x 2 root root 4096 3月 12 02:45 cron.daily
drwxr-xr-x 2 root root 4096 2月 16 04:20 cron.hourly
drwxr-xr-x 2 root root 4096 2月 16 04:34 cron.monthly
-rw-r--r-- 1 root root 722 4月 6 2016 crontab
drwxr-xr-x 2 root root 4096 2月 16 04:34 cron.weekly