Ubuntu - Some Linux Command
sudo passwd
- 安裝(考慮相依): apt-get install <package name>
- 安裝: pip install <package name>==<version if needed>
- 查尋版本: dpkg -l <package name>
- 搜尋: apt-cache search [search item]
- 更新: apt-get update
- 移除(考慮相依): apt-get remove
- 清除下載的暫存(on /var/cache/apt/archives): apt-get clean
- 壓 縮:tar -jcv -f filename.tar.bz2 要被壓縮的檔案或目錄名稱
- 查 詢:tar -jtv -f filename.tar.bz2
- 解壓縮:tar -jxv -f filename.tar.bz2 -C 欲解壓縮的目錄
- 取代字串: :%s/<被取代>/<取代>/g
- 取代字串: :g/被替代的字串/s//新字串/
- 複製貼上: dd (cut) p(貼上) yy(copy)
- 比較差異: vim -d [file1] [file2]
- 重啟dhcp server: /etc/init.d/isc-dhcp-server restart
- Get dhcp: dhclient <network interface>
- 重啟網路: /etc/init.d/networking restart
- DNS 設定: /etc/resolv.conf
- 設定network interface: /etc/network/interface
- 找錯IP: /etc/udev/ruled.d/70-persistent-net.rules
- Bridge:
brctl addbr <name>
brctl addif br0 eth0
brctl show ifconfig eth1 0.0.0.0
mount <IP>:<遠端路徑> <本端路徑>
example: mount 10.103.1.249:/nfs_public /mnt/nfs_public
- Copy ISO to USB (2 method)
- sudo dd if=[iso path] of=dev/sdb bs=4k(1M)
- cat [iso path] > /dev/sdb
- ps aux |grep <process name>
- ps -ef |grep <process name>
Kill -9 pid
- "apt-get install synaptic"
- "synaptic" >> ssh install
- remove # from /etc/ssh/sshd_config 22
- sudo /etc/init.d/ssh restart
- sshd-config PermitRootLogin yes(no neccessary)