Linux一些陌生命令和概念总结

本文介绍了多种网络连接管理和文件系统操作的实用命令,包括netstat、ip、ss等工具的使用方法,以及inode、block、journal的概念。此外,还提供了iptables配置示例和系统资源监控命令如uptime、free、vmstat的介绍。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

netstat — print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
ip — show / manipulate routing, devices, policy routing and tunnels.
ss — another utility to investigate sockets.

Filesystem — a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device(s) which contain it.
Inode — an Index Node, is a structure which store all the information about a file system object (file, directory, etc.) except data content and file name.
Block — a minimum chunk of disk space which can be allocated. It usually defaults to 4096 bytes, or 4 Kilobytes.
Journal — a structure which allows the filesystem track of what was written and when. This allows to quickly understand what was not properly written in case of power outage or similar problem.

tune2fs — print out and change file system parameters.

 1: sudo iptables-save
 2: sudo iptables -t filter -A INPUT -i lo -j ACCEPT
 3: sudo iptables -t filter -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
 4: sudo iptables -t filter -P INPUT DROP
 5: sudo iptables -nt filter -L --line-numbers
 6: ping -c 2 -W 1 10.0.2.2
 7: sudo iptables -t filter -A INPUT --match state --state ESTABLISHED -j ACCEPT
 8: sudo iptables -nt filter -L --line-numbers
 9: ping -c 2 -W 1 10.0.2.2
10: sudo modprobe ipt_LOG
11: sudo iptables -nt raw -L --line-numbers
12: sudo iptables -t raw -A PREROUTING -p udp -m udp --dport 1024 -j TRACE
13: sudo iptables -t raw -A OUTPUT -p udp -m udp --sport 1024 -j TRACE
14: sudo tail -n0 -f /var/log/kern.log | cut -c52-300 &
15: nc -ulp 1024 &
16: echo 'Hello there!' | nc -u localhost 1000
17: <CTRL+C>
18: fg
19: <CTRL+C>
20: fg
21: <CTRL+C>

uptime — how long the system has been running.
free — display amount of free and used memory in the system.
vmstat — information about processes, memory, paging, block IO, traps, disks and cpu activity.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值