############### cpu ########################################
1、 cpu :
cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l
2、 cpu core :
cat /proc/cpuinfo |grep "cpu cores"|wc -l
3、 cpu :
cat /proc/cpuinfo |grep "processor"|wc -l
cpu * = cpu ( )
###################### #####################################
:
uname -a
:
uname -r
32 64 :
file /sbin/init
:
cat /etc/issue
lsb_release -a
:
lsmod
pci :
lspci
sudo ./slow.sh > test.log
PHP
dpkg -l|grep php
su -p
uname -a ( , 、 、 、 )
cat /etc/issue
tailf /var/log/apache2/access.log linux
apt-get install php5-curl PHP5 CURL
crontab -l
ps aux | grep mysql MYSQL
diff -r files1 files2
dpkg -S tomcat tomcat
apt-get remove --purge tomcat tomcat
du -h --max-depth=1
ps aux |sort -nk +4|tail 10 ,
--skip-lock-tables , , ,
grep proxy * proxy
/etc/init.d/apache2 force-reload
xxx :dpkg -L xxx
:apt-cache search
:aptitude search
:dpkg -S filename
:apt-file search filename
xxx :apt-cache depends xxx
xxx :apt-cache rdepends xxx
:sudo apt-cdrom add
:sudo apt-get update;sudo apt-get dist-upgrade
:dpkg -l |grep ^rc|awk ‘{print $2}’ |sudo xargs dpkg -P
h :sudo auto-apt run ./configure
:ls /var/cache/apt/archives
:dpkg �Cget-selections | grep -v deinstall > ~/somefile
:dpkg �Cset-selections < ~/somefile;sudo dselect
:sudo apt-get autoclean
:sudo apt-get clean
:sudo apt-get autoremove
:apt-get -qq �Cprint-uris install ssh | cut -d\’ -f2
:uname -a
Ubuntu :cat /etc/issue lsb_release -a
:lsmod
PCI :lspci
USB :lsusb -v
:sudo ethtool eth0
CPU :cat /proc/cpuinfo
:sudo lshw
:uptime
:sudo fdisk -l
:sudo fdisk /dev/sda
:sudo mkfs.ext3 /dev/sda1
( , ):sudo fsck /dev/sda1
:sudo mount -t (-o nls=utf8 -o iocharset=utf8)
:sudo umount
IDE :sudo hdparm -i /dev/hda
STAT :sudo hdparm -I /dev/sda sudo blktool /dev/sda id
:df
:du -hs
:sync;fuser -km /media/usbdisk
:sudo iostat -x 2
:free
:top
:ps -A
:pstree
:kill killall
:kill -9 killall -9
:xkill ,
:lsof -p
abc.txt :lsof abc.txt
22 :lsof -i :22
nsd :lsof -c nsd
, , :nohup &
:strace -f -F -o outfile
:ulimit -n 4096 echo 4096 > /proc/sys/fs/file-max
ADSL :sudo pppoeconf
ADSL :sudo pon dsl-provider
ADSL:sudo /etc/ppp/pppoe_on_boot
ADSL :sudo poff
:sudo plog
:w3m -no-cookie -dump ‘http://usere:[email protected]/dyndns/update?system=dyndns&hostname=yourdns.3322.org’
IP :arping IP
IP :nmblookup -A IP
IP :ifconfig eth0 |awk ‘/inet/ {split($2,x,”:”);print x[2]}’
IP :w3m -no-cookie -dump www.123cha.com|grep -o ‘[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}’
80 :lsof -i :80
:arp -a | awk ‘{print $4}’
IP :sudo ifconfig eth0:0 1.2.3.4 netmask 255.255.255.0
nat :echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward; sudo iptables -t nat -I POSTROUTING -j MASQUERADE
:netstat -rn sudo route -n
:sudo route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1
:sudo route del -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1
MAC :sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
IP :netstat -na|grep ESTABLISHED|awk ‘{print $5}’|awk -F: ‘{print $1}’|sort|uniq -c|sort -r -n
IPV6 :echo ‘blacklist ipv6′ | sudo tee /etc/modprobe.d/blacklist-ipv6
:sudo netstat -atnp
ADSL :sudo ethstatus -i ppp0
:whois baidu.cn
:tracepath baidu.cn
IP :sudo dhclient
:wget -r -p -np -k http://www.xxx.com
5 :axel -n 5 http://www.xxx.com/downloadfile.zip
:sudo update-rc.d defaults 99
:sudo update-rc.d remove
:/etc/init.d/ restart
:/etc/init.d/ stop
:/etc/init.d/ start
:sudo adduser
:sudo deluser
:passwd
:sudo passwd
:sudo chfn userid
:sudo usermod -L sudo passwd -l
:sudo usermod -U sudo passwd -u
admin :sudo usermod -G admin -a
Java :sudo update-alternatives �Cconfig java
:export http_proxy=http://xx.xx.xx.xx:xxx
:sudo vim /etc/motd
sun java :sudo update-java-alternatives -s java-6-sun
:im-switch -c
GBK UTF8 :convmv -r -f cp936 -t utf8 �Cnotest �Cnosmart *
GBK UTF8 :iconv -f gbk -t utf8 $i > newfile
mp3 :sudo apt-get install python-mutagen;find . -iname ‘*.mp3′ -execdir mid3iconv -e GBK {} \;
:sudo apt-get install zhcon;zhcon �Cutf8 �Cdrv=vga
lftp Windows FTP :lftp :~>set ftp:charset GBK
PDF :sudo apt-get install xpdf-chinese-simplified xpdf-chinese-traditional poppler-data
:cat
:more
:less
:grep
:grep -l -r
:grep -L -r
:find -name
:touch file1 file2
:mkdir �Cp /tmp/xxs/dsd/efd
:rm �Cfr /tmp/xxs
:cd ~
:pwd
:ls -a
:mv / / /
:cp -av
:file filename
:diff file1 file2
xxx 6 :tail -n 6 xxx
:tail -n 10 -f /var/log/apache2/access.log
10 :sed -n ‘5,10p’ /var/log/apache2/access.log
xxx :apropos xxx man -k xxx
ssh :scp -rp /path/filename username@remoteIP:/path
rm rmvb :rename ’s/.rm$/.rmvb/’ *
:rename ‘tr/A-Z/a-z/’ *
�Chelp.txt :rm ― �Chelp.txt rm ./�Chelp.txt
:ls -d */. echo */.
30 back :find . -type f -atime -30 -exec mv {} ../back \;
xxxx :find . -type f -mmin -60|xargs -i grep -l xxxx ‘{}’
2 8 :find . -mmin +120 -mmin -480 -exec more {} \;
30 :find . -type f -mtime +30 -mtime -3600 -exec rm {} \;
30 :find . -type f -ctime +30 -ctime -3600 -exec rm {} \;
guest avi rm :find . -name ‘*.avi’ -o -name ‘*.rm’ -user ‘guest’ -exec rm {} \;
java xml 7 :find . ! -name *.java ! -name ‘*.xml’ -atime +7 -exec rm {} \;
.svn :find . -name .svn -type d -exec rm -fr {} \;
“~” :find . -name ‘*~’ -exec rm {} \;
:ls .|wc -w
:ls -l |grep ^d|wc -l
2006-01-01 :ls -l |grep 2006-01-01 |awk ‘{print $8}’
ssh :rsync -Pa -I �Csize-only �Cdelete �Ctimeout=300 Remote_IP:/home/ubuntu /backup
7Z :sudo apt-get install p7zip p7zip-full p7zip-rar
rar :sudo apt-get install rar unrar
xxx.tar.gz :tar -zxvf xxx.tar.gz
xxx.tar.bz2 :tar -jxvf xxx.tar.bz2
aaa bbb xxx.tar.gz :tar -zcvf xxx.tar.gz aaa bbb
aaa bbb xxx.tar.bz2 :tar -jcvf xxx.tar.bz2 aaa bbb
lha :sudo apt-get install lha
cab :sudo apt-get install cabextract
:cal
:date -s mm/dd/yy
:date -s HH:MM
CMOS :hwclock �Csystohc
CMOS :hwclock �Cshow
CMOS :hwclock �Chctosys
:sudo ntpdate ntp.ubuntu.com
:sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
UTC, CMOS。:sudo sed -ie ’s/UTC=yes/UTC=no/g’ /etc/default/rcS;sudo hwclock �Csystohc
mysql root :sudo mysqladmin -u root -p password ‘ ’
:xset dpms force off
CPU :sudo apt-get install cpufrequtils;sudo cpufreq-info
:sudo halt
:sudo shutdown -h now
11 :sudo shutdown -h 23:00
60 :sudo shutdown -h +60
:sudo reboot
:sudo shutdown -r now
:synclient touchpadoff=1
:synclient touchpadoff=0
:awk ‘{arr[$1]+=1 }END{for(i in arr){print arr[i]“\t”i}}’ FILE_NAME | sort -rn
80 :netstat -na|grep :80|awk ‘{print $5}’|awk -F: ‘{print $1}’|sort|uniq -c|sort -r -n
:sudo apt-get install nautilus-open-terminal
Totem :rm ~/.recently-used
vim :sudo cp /usr/share/vim/vimcurrent/vimrc_example.vim /usr/share/vim/vimrc
vim .gz :sudo apt-get install vim-full
vim ::set number
:ls ~/.config/autostart
wine :sudo sed -ie ‘/GBK/,/^}/d’ /usr/share/X11/locale/zh_CN.UTF-8/XLC_LOCALE
ISO :mkisofs -o test.iso -Jrv -V test_disk /home/carla/
10 :gnome-screenshot -d 10
5 :gnome-screenshot -w -d 5
:cdrecord -scanbus;cdrecord -v -eject speed=8 dev=1,1,0 test.iso
:~/.local/share/Trash/
:~/.local/share/applications/mimeapps.list
HTTP :w3m -dump_head http://www.xxx.com
:watch -d free
root :sudo -Hs
ntfs :sudo mount -t ntfs -o nls=utf8,umask=0 /dev/sdb1 /mnt/c
ntfs :sudo mount -t ntfs-3g -o locale=zh_CN.utf8,umask=0 /dev/sdb1 /mnt/c
fat32 :sudo mount -t vfat -o iocharset=utf8,umask=0 /dev/sda1 /mnt/c
:sudo mount -t smbfs -o username=xxx,password=xxx,iocharset=utf8 //192.168.1.1/share /mnt/share
ISO :sudo mount -t iso9660 -o loop,utf8 xxx.iso /mnt/iso
:nl
rmvb avi:for i in *; do mencoder -oac mp3lame -lameopts vbr=3 -ovc xvid -xvidencopts fixed_quant=4 -of avi $i -o `echo $i | sed -e ’s/rmvb$/avi/’`; done
svg png:for i in *; do inkscape $i �Cexport-png=`echo $i | sed -e ’s/svg$/png/’`; done
30%:for i in *; do convert -resize 30%x30% $1 sm-$1; done
jpg png:for i in *; do convert $i `echo $i | sed -e ’s/jpg$/png/’`; done
jpg (Exif):identify -verbose xxx.jpg
:nc -zv localhost 1-65535
^M:cat filename | tr -d “^M” > newfile
^M:sed -e “s/^M//g” filename > newfile
bin/cue iso :sudo apt-get install bchunk;bchunk image.bin image.cue image
iso :mkisofs dirname -o isofile.iso
CD iso :dd if=/dev/cdrom of=isofile.iso
ape flac:sudo apt-get install flac shntool;shntool split -t “%n.%p-%t” -f example_UTF-8.cue -o flac example.ape -d flacOutputDir
ape mp3:sudo apt-get install flac shntool lame;shntool split -t “%n.%p-%t” -f example_UTF-8.cue -o ‘cust ext=mp3 lame �Cr3mix -b 320 �Cquiet �C %f’ example.ape -d mp3OutputDir
:sudo apt-get install rkhunter;rkhunter �Ccheckall
:sudo apt-get install clamav;clamscan -r ~/
:netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’
:ps -eo fname,rss|awk ‘{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}’|sort -k2 -nr
:free -m |grep “Mem” | awk ‘{print $2}’
:ps -eo “%C : %p : %z : %a”|sort -k5 -nr
cpu :ps -eo “%C : %p : %z : %a”|sort -nr
jpg :find . -name *.jpg -exec wc -c {} \;|awk ‘{print $1}’|awk ‘{a+=$1}END{print a}’
:ps -eal | awk ‘{ if ($2 == “Z”) {print $4}}’ | sudo kill -9
CD mp3 ( ):sudo apt-get install abcde;abcde -o mp3 -b
CD Flac ( ):sudo apt-get install abcde;abcde -o flac -b
:apt-cache stats
:apt-cache pkgnames
:apt-cache show k3b
dmidecode | grep "Product Name"
AddDefaultCharset
AddDefaultCharset Off HTTP
AddDefaultCharset On Apache iso-8859-1