1. ps auxPROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
For BSD formats and when the stat keyword is used, additional characters may
be displayed:
< high-priority (not nice to other users)
N low-priority (nice to other users)
L has pages locked into memory (for real-time and custom IO)
s is a session leader
l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+ is in the foreground process group
2. od
od可以以8\10\16\ASCII\进制方式显示文件内容,举例:
od -t x1 -Ax -c main.c
x1表示以一个字节16进制为单位显示文件内容,Ax表示地址偏移是用16进制表示,c表示以ASCII字符方式显示
3. tar cvf - ~/downloads | tar xvf - -C /tmp
4. cat records.txt | tr " " "\n" | sort
5. strace / ltrace
strace可以用来打印系统调用; ltrace用来打印库函数调用,即使使用自定义的库,也可打印出被调用函数名
-T 显示单个syscall耗时
-p 挂载到正在运行的进程上
-s 设置结果中显示printf等中打印的字符串长度,默认32
6. nc 传文件
server端
tar czf - ./library.a | nc -l 11111
client端
nc ip port | tar zxvf -
阅读(1516) | 评论(0) | 转发(0) |