我想做一个比 man 更有实际用途的命令手册,等 YLinux.org 社区搭建起来再说。先散记于此。

stty

设置和查看 terminal 的一些设置,比如行分隔符,文件结束符,中断程序执行 符等等:

$ stty -a
speed 38400 baud; rows 40; columns 142; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

可以看到我的系统上,文件结束符(eof)是 ^D (ctrl+d);中断程序执行符 (intr)是 ^C (ctrl+c) ... ...

pidof — 查看进程 ip

pidof firefox

加入你的系统上 firefox 正在运行,上面命令发挥 firefox 进程的 id 。

strace — 跟踪进程

strace -p $(pidof fcitx)

pidof 命令发挥 fcitx 的进程 id , strace 的 -p 参数可以指定要跟踪的进程 id。