本文摘自:http://www.acnis.com/modules.php?name=ArticlE&file=article&sid=214&mode=thread&order=0&thold=0
自己用來做個記錄……
此文描述了自ubuntu 5.10版本之后的系統所代命令參數,dapper,edgy以及7.04版本中可能會有一些變動,于此文不同,如有疑問可以發郵件給isher或訪問wiki.ubuntu.com.cn
下面內容及向心內文的內容均為ubuntu(cn)的wiki中摘錄,為方便廣大是用ubuntu的使用者查找和使用,特摘錄安裝 查看軟件xxx安裝內容
查詢軟件xxx被哪些包依賴
自己用來做個記錄……
此文描述了自ubuntu 5.10版本之后的系統所代命令參數,dapper,edgy以及7.04版本中可能會有一些變動,于此文不同,如有疑問可以發郵件給isher或訪問wiki.ubuntu.com.cn
下面內容及向心內文的內容均為ubuntu(cn)的wiki中摘錄,為方便廣大是用ubuntu的使用者查找和使用,特摘錄安裝 查看軟件xxx安裝內容
- dpkg -L xxx
- apt-cache search 正則表達式
- dpkg -S filename
apt-file search filename
- apt-cache depends xxx
查詢軟件xxx被哪些包依賴
- apt-cache rdepends xxx
- sudo apt-cdrom add
- sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
- dpkg -l |grep ^rc|awk '{print $2}' |tr ["n"] [" "]|sudo xargs dpkg -P -
- sudo auto-apt run ./configure
- ls /var/cache/apt/archives
- dpkg --get-selections | grep -v deinstall > ~/somefile
- dpkg --set-selections < ~/somefile
sudo dselect
- sudo apt-get autoclean
- sudo apt-get clean
- sudo apt-get autoremove
- apt-get -qq --print-uris install ssh | cut -d' -f2
- uname -a
- cat /etc/issue
- lsmod
- lspci
- lsusb
- sudo ethtool eth0
- cat /proc/cpuinfo
- lshw
- sudo fdisk -l
- sudo hdparm -i /dev/hda
- sudo hdparm -I /dev/sda
或
sudo apt-get install blktool
sudo blktool /dev/sda id
- df -h
df -H
- du -hs 目錄名
- sync
fuser -km /media/usbdisk
- free -m
- ps -A
- kill 進程號(就是ps -A中的第一列的數字)
或者 killall 進程名
- kill -9 進程號
或者 killall -9 進程名
- xkill 出現骷髏標志的鼠標,點擊需要中止的程序即可
- top
- lsof -p
- sudo pppoeconf
- sudo pon dsl-provider
- sudo /etc/ppp/pppoe_on_boot
- sudo poff
- sudo plog
- #首先去 http://www.3322.org 申請一個動態域名
#然后修改 /etc/ppp/ip-up 增加撥號時更新域名指令
sudo vim /etc/ppp/ip-up
#在最后增加如下行
w3m -no-cookie -dump 'http://username:password@members.3322.org/dyndns/update?system=dyndns&hostname=yourdns.3322.org'
- arping IP地址
- ifconfig eth0 |awk '/inet/ {split($2,x,":");print x[2]}'
- w3m -no-cookie -dump www.ip138.com|grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'
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}'
w3m -no-cookie -dump ip.loveroot.com|grep -o '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'
- lsof -i :80
- arp -a | awk '{print $4}'
ifconfig eth0 | head -1 | awk '{print $5}'
- 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
- sudo ifconfig eth0 down #關閉網卡
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE #然后改地址
sudo ifconfig eth0 up #然后啟動網卡
- netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r -n
netstat -na|grep SYN|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r -n
- tcpdump -tnn -c 20000 -i eth0 | awk -F "." '{print $1"."$2"."$3"."$4}' | sort | uniq -c | sort -nr | awk ' $1 > 100 '
- echo "blacklist ipv6" | sudo tee /etc/modprobe.d/blacklist-ipv6
- sudo update-rc.d 服務名 defaults 99
- sudo update-rc.d 服務名 remove
- /etc/init.d/服務名 restart
- /etc/init.d/服務名 stop
- /etc/init.d/服務名 start
- sudo update-alternatives --config java
- sudo chfn userid
- export http_proxy=http://xx.xx.xx.xx:xxx
- sudo vim /etc/motd
- sudo apt-get install convmv
convmv -r -f cp936 -t utf8 --notest --nosmart *
- find src -type d -exec mkdir -p utf8/{} ;
find src -type f -exec iconv -f GBK -t UTF-8 {} -o utf8/{} ;
mv utf8/* src
rm -fr utf8
- iconv -f gbk -t utf8 $i > newfile
- sudo apt-get install python-mutagen
find . -iname “*.mp3” -execdir mid3iconv -e GBK {} ;
- sudo apt-get install zhcon
使用時,輸入zhcon即可
- whereis filename
- find 目錄 -name 文件名
- file filename
- tail -n 6 xxx
- tail -n 10 -f /var/log/apache2/access.log
- sed -n '5,10p' /var/log/apache2/access.log
- grep -l -r xxx .
- apropos xxx
man -k xxx
- scp -rp /path/filename username@remoteIP:/path #將本地文件拷貝到服務器上
scp -rp username@remoteIP:/path/filename /path #將遠程文件從服務器下載到本地
- lsof 文件名
- rename 's/.rm$/.rmvb/' *
- rename 'tr/A-Z/a-z/' *
- rm -- --help.txt 或者 rm ./--help.txt
- ls -d */. 或 echo */.
- find . -type f -atime -30 -exec mv {} ../back ;
- find . -mmin +120 -mmin -480 -exec more {} ;
- find . -type f -mtime +30 -mtime -3600 -exec rm {} ;
- find . -name '*.avi' -o -name '*.rm' -user 'guest' -exec rm {} ;
- find . ! -name *.java ! -name ‘*.xml’ -atime +7 -exec rm {} ;
- ls /usr/bin|wc -w
- ls -l /usr/bin|grep ^d|wc -l
- ls -l |grep 2006-01-01 |awk '{print $8}'
- tar -zxvf xxx.tar.gz
- tar -jxvf xxx.tar.bz2
- tar -zcvf xxx.tar.gz aaa bbb
- tar -jcvf xxx.tar.bz2 aaa bbb
- Ctrl+h
- Ctrl+l
- * computer:/// - 全部掛載的設備和網絡
* network:/// - 瀏覽可用的網絡
* burn:/// - 一個刻錄 CDs/DVDs 的數據虛擬目錄
* smb:/// - 可用的 windows/samba 網絡資源
* x-nautilus-desktop:/// - 桌面項目和圖標
* file:/// - 本地文件
* trash:/// - 本地回收站目錄
* ftp:// - FTP 文件夾
* ssh:// - SSH 文件夾
* fonts:/// - 字體文件夾,可將字體文件拖到此處以完成安裝
* themes:/// - 系統主題文件夾
- 在nautilus的地址欄里輸入”fonts:///“,就可以查看本機所有的fonts
- strace -f -F -o outfile <cmd>
- #date -s mm/dd/yy
- #date -s HH:MM
- hwclock --systohc
- hwclock --hctosys
- sudo ntpdate time.nist.gov
sudo ntpdate time.windows.com
- Ctrl + ALT + ←
Ctrl + ALT + →
- Ctrl + ALT + Fn(n:1~7)
- SHIFT + pageUp/pageDown
- setterm -dump n(n:1~7)
- /var/lib/mysql
- mysqldump 數據庫名 > 文件名 #導出數據庫
mysqladmin create 數據庫名 #建立數據庫
mysql 數據庫名 < 文件名 #導入數據庫
- sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
sudo mysqladmin -u user password 'newpassword''
sudo mysqladmin flush-privileges
- sudo mysqladmin -uroot -p password '你的新密碼'
- wget -r -p -np -k http://www.21cn.com
· -r:在本機建立服務器端目錄結構;
· -p: 下載顯示HTML文件的所有圖片;
· -np:只下載目標站點指定目錄及其子目錄的內容;
· -k: 轉換非相對鏈接為相對鏈接。
- rm ~/.recently-used
- 點擊菜單,鼠標停留在某條菜單上,鍵盤輸入任意你所需要的鍵,可以是組合鍵,會立即生效;
如果要清除該快捷鍵,請使用backspace
- sudo cp /usr/share/vim/vimcurrent/vimrc_example.vim /usr/share/vim/vimrc
- cd ~/.config/autostart
rm 需要刪除啟動程序
- sudo sed -ie '/GBK/,/^}/d' /usr/share/X11/locale/zh_CN.UTF-8/XLC_LOCALE