常用的shell命令记录
#一句话修改用户命令
echo py.10isp.com | passwd --stdin root
echo py.10isp.com | passwd root --stdin
#使用命令查看依然占用空间的已删除文件
lsof | grep delete
#批量删除进程,将panyan替换成需要kill的进程名
ps -ef¦grep panyan ¦grep -v grep¦awk '{print "kill -9 " $2}' ¦sh
#删除配置文件中注释语句
cp http.conf fttp.conf.back grep -v "^#" fttp.conf.back > http.conf
#统计当前目录下的文件夹的大小
du . --max-depth=1 -h
#打包文件夹排除某些文件
tar -zcvf public_html.$(date +%F%M).tar.gz public_html --exclude "*.jpg" --exclude "*.txt" --exclude "*.inc" --exclude "*.gif" --exclude "*.png"
#打包排除某个目录
tar -zcvf www.20130813.tar.gz www/ --exclude www/uploads
#查看内存型号
dmidecode | grep -A16 "Memory Device"
dmidecode | grep -A16 "Memory Device" | grep Size
#查看LINUX服务器序列号
dmidecode -t 1
dmidecode 2.10 SMBIOS 2.5 present.
Handle 0x0100, DMI type 1, 27 bytes System Information Manufacturer: Dell Inc.
Product Name: PowerEdge 1950 Version: Not Specified
Serial Number: *******
UUID: *******-*******-*******-*******-*******
Wake-up Type: Power Switch SKU
Number: Not Specified
Family: Not Specified