扩展硬盘
fdisk /dev/sda
np
3
w
mkfs -t ext3 /dev/sda3
mount -t fstype /dev/sda3 /opt/disk
umount /dev/sda3
查看当前的大小
fdisk -l
df -h 整个硬盘大小
du -h 当前文件大小
由进程名得到进程ID
pidof 进程名
由进程id得到进程名
readlink /proc/进程ID/exe
chkconfig 会列出现在当前服务的各种状态,包括在不同运行级别下的启情况
ttcp -tsv host port
ttcp -rsv
netstat -r
netstat -t
nestat -s
跟踪系统调用
strace 命令
lsof -i protocol@host : port
跨机器拷贝
scp 文件 用户名@172.25.38.13:路径
显示行号,并且从第N到M行
cat -n file.txt | sed 'N,Mp'
if [[ $2 -le 5 ]] ; then
start=1else
start=$[$2-5]
fi
end=$[$2+5]
cat -n $1 | sed -n ''$start','$end'p'