linux: 19 items found.

tcpdump常用命令

监视指定主机的数据包

打印所有进入或离开sundown的数据包.

tcpdump host sundown

也可以指定ip,例如截获所有210.27.48.1 的主机收到的和发出的所有的数据包

tcpdump host 210.27.48.1 

打印helios 与 hot 或者与 ace 之间通信的数据包

tcpdump host helios and ( hot or ace )

截获主机210.27.48.1 和主机210.27.48.2 或210.27.48.3的通信

tcpdump host 210.27.48.1 and (210.27.48.2 or 210.27.48.3 ) 

打印ace与任何其他主机之间通信的IP 数据包, 但不包括与helios之间的数据包.

tcpdump ip host ace and not helios

如果想要获取主机210.27.48.1除了和主机210.27.48.2之外所有主机通信的ip包,使用命令:

tcpdump ip host 210.27.48.1 and ! 210.27.48.2

截获主机hostname发送的所有数据

tcpdump -i eth0 src host hostname

监视所有送到主机hostname的数据包

tcpdump -i eth0 dst host hostname
查看更多 ~

是时间将CentOS8 升级为CentOS Stream了

CentOS8 的生命周期到2021年12月31日截止,CentOS7是到2024年6月30日。还有使用CentOS8的注意了,官方可能不再更新,需要将系统升级到CentOS Stream.

升级也很简单:

dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync

附 CentOS Stream 下截地址:

http://mirrors.cqu.edu.cn/CentOS/8-stream/isos/x86_64/
http://mirrors.aliyun.com/centos/8-stream/isos/x86_64/
http://mirrors.neusoft.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.163.com/centos/8-stream/isos/x86_64/
http://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.ustc.edu.cn/centos/8-stream/isos/x86_64/
http://ftp.sjtu.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.nju.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.bfsu.edu.cn/centos/8-stream/isos/x86_64/

查看更多 ~

linux命令: awk

awk

文本和数据进行处理的编程语言

补充说明

awk 是一种编程语言,用于在 linux/unix 下对文本和数据进行处理。数据可以来自标准输入(stdin)、一个或多个文件,或其它命令的输出。它支持用户自定义函数和动态正则表达式等先进功能,是 linux/unix 下的一个强大编程工具。它在命令行中使用,但更多是作为脚本来使用。awk 有很多内建的功能,比如数组、函数等,这是它和 C 语言的相同之处,灵活性是 awk 最大的优势。

awk 命令格式和选项

语法形式

awk [options] 'script' var=value file(s)
awk [options] -f scriptfile var=value file(s)
查看更多 ~

Linux 命令:flock - 对打开的文件加锁或解锁

先来看看flock -h 的用法:

Usage:
 flock [options] <file|directory> <command> [command args]
 flock [options] <file|directory> -c <command>
 flock [options] <file descriptor number>

Options:
 -s  --shared             get a shared lock
 -x  --exclusive          get an exclusive lock (default)
 -u  --unlock             remove a lock
 -n  --nonblock           fail rather than wait
 -w  --timeout <secs>     wait for a limited amount of time
 -E  --conflict-exit-code <number>  exit code after conflict or timeout
 -o  --close              close file descriptor before running command
 -c  --command <command>  run a single command string through the shell

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see flock(1).
查看更多 ~