Usage of Ubuntu Commands
MobaXterm
screen/tmux
1. tmux attach -t 0 (web)
2. tmux attach -t 2 (rt)
FKVM
power off the server with IPMI, power off the tray in iLab, power up the tray in iLab, then power the server back on with IPMI.
Power commands to power server up and down:
ipmitool -I lanp -U admin -P password -H ***.***.***.*** power off
ipmitool -I lanp -U admin -P password -H ***.***.***.*** power on
Ubuntu下安裝VNC server
http://www.linuxidc.com/Linux/2007-11/9252.htm
vnc server
http://bbs.csdn.net/topics/392040167
// 更改VNC密碼
vncpasswd
$sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
vim .vnc/xstartup
#################################################
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-session &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
#################################################
用dd命令克隆ubuntu系統(tǒng) (2014-04-15 10:49:36)
http://blog.sina.com.cn/s/blog_6e8b0a010101gbco.html
Ubuntu升級GCC版本
Ubuntu 14.04 LTS 下升級 gcc 到 gcc-4.9罚勾、gcc-5 版本
https://www.cnblogs.com/BlackStorm/p/5183490.html
安裝新版gcc/g++
(Ubuntu 14.04 LTS)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
sudo updatedb && sudo ldconfig
locate gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
mount命令(用來掛載硬盤或鏡像等)
https://www.cnblogs.com/itech/archive/2009/08/07/1541061.html
zip/unzip
Linux中zip壓縮和unzip解壓縮命令詳解
1、把/home目錄下面的mydata目錄壓縮為mydata.zip
zip -r mydata.zip mydata #壓縮mydata目錄
2傻谁、把/home目錄下面的mydata.zip解壓到mydatabak目錄里面
unzip mydata.zip -d mydatabak
3龄砰、把/home目錄下面的abc文件夾和123.txt壓縮成為abc123.zip
zip -r abc123.zip abc 123.txt
4肛宋、把/home目錄下面的wwwroot.zip直接解壓到/home目錄里面
unzip wwwroot.zip
5舰罚、把/home目錄下面的abc12.zip微谓、abc23.zip森篷、abc34.zip同時解壓到/home目錄里面
unzip abc*.zip
6、查看把/home目錄下面的wwwroot.zip里面的內容
unzip -v wwwroot.zip
7豺型、驗證/home目錄下面的wwwroot.zip是否完整
unzip -t wwwroot.zip
8仲智、把/home目錄下面wwwroot.zip里面的所有文件解壓到第一級目錄
unzip -j wwwroot.zip
su/sudo
【linux】su、sudo姻氨、sudo su钓辆、sudo -i的用法和區(qū)別
來源:http://bbs.csdn.net/topics/390938651
sudo : 暫時切換到超級用戶模式以執(zhí)行超級用戶權限,提示輸入密碼時該密碼為當前用戶的密碼肴焊,而不是超級賬戶的密碼前联。不過有時間限制,Ubuntu默認為一次時長15分鐘娶眷。
su : 切換到某某用戶模式似嗤,提示輸入密碼時該密碼為切換后賬戶的密碼,用法為“su 賬戶名稱”届宠。如果后面不加賬戶時系統(tǒng)默認為root賬戶烁落,密碼也為超級賬戶的密碼。沒有時間限制豌注。
sudo -i: 為了頻繁的執(zhí)行某些只有超級用戶才能執(zhí)行的權限伤塌,而不用每次輸入密碼,可以使用該命令幌羞。提示輸入密碼時該密碼為當前賬戶的密碼寸谜。沒有時間限制。執(zhí)行該命令后提示符變?yōu)椤?”而不是“$”。想退回普通賬戶時可以執(zhí)行“exit”或“l(fā)ogout” 熊痴。
sudo -i 直接運行sudo命令加-i參數
sudo su 運行sudo命令給su命令提權他爸,運行su命令。
sudo -i 運行結果 PWD=/root
sudo su 運行結果 PWD=/home/用戶名(當前用戶主目錄)
cscope + ctags
http://blog.csdn.net/lee244868149/article/details/38980937
[vim+ctags+cscope安裝與使用總結(不斷補充中)]
[Goooood]http://blog.csdn.net/luckywang1103/article/details/44181557
#!/bin/sh
find . -name "*.h" -o -name "*.c" -o -name "*.cc" > cscope.files
cscope -bkq -i cscope.files
ctags -R
cscope
Vim Cscope安裝與使用
https://www.cnblogs.com/luosongchao/p/3205166.html
--安裝
sudo apt-get install csope 安裝Cscope
cscope -Rbq
cscope.out, cscope.in.out, cscope.po.out
其中cscope.out是基本的符號索引果善,后兩個文件是使用"-q"選項生成的诊笤,可以加快cscope的索引速度。上面命令的參數含義如下:
-R: 在生成索引文件時巾陕,搜索子目錄樹中的代碼
-b: 只生成索引文件讨跟,不進入cscope的界面
-k: 在生成索引文件時,不搜索/usr/include目錄
-q: 生成cscope.in.out和cscope.po.out文件鄙煤,加快cscope的索引速度
-i: 如果保存文件列表的文件名不是cscope.files時晾匠,需要加此選項告訴cscope到哪兒去找源文件列表√莞眨可以使用"-"凉馆,表示由標準輸入獲得文件列表。
-I dir: 在-I選項指出的目錄中查找頭文件
-u: 掃描所有文件亡资,重新生成交叉索引文件
-C: 在搜索時忽略大小寫
-P path: 在以相對路徑表示的文件前加上的path澜共,這樣,你不用切換到你數據庫文件所在的目錄也可以使用它了锥腻。
--使用
vim ~/.vimrc
10 " ctags
11 set tags=/home/xiongyuan/workspace/git/autonomousdriving_flex-tinyyolo_with_avm/tags
12 " cscope
13 cs add cscope.out
vim -t main
:cs add cscope.out
:cs -h
cscope commands:
add : Add a new database (Usage: add file|dir [pre-path] [flags])
find : Query for a pattern (Usage: find c|d|e|f|g|i|s|t name)
c: Find functions calling this function
d: Find functions called by this function
e: Find this egrep pattern
f: Find this file
g: Find this definition
i: Find files #including this file
s: Find this C symbol
t: Find this text string
help : Show this message (Usage: help)
kill : Kill a connection (Usage: kill #)
reset: Reinit all connections (Usage: reset)
show : Show connections (Usage: show)
Press ENTER or type command to continue
cscope + ctags
sudo apt-get install ctags
ctags -R
vnc4server
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
ffmepg
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
Ubuntu
sudo apt-get install vim git g++ cmake tree terminator vnc4server