Ubuntu Terminal commands

htop

watch cpu occupatation
Note that you need to install htop before using, i.e., $ sudo apt-get install htop

htop

在這裏插入圖片描述
or use: top

top

nvidia-smi

watch Gpu occupatation

nvidia-smi

or watch Gpu per 10 seconds

watch -n 10 nvidia-smi

在這裏插入圖片描述

git clone

download sources from github, e.g.,

git clone https://github.com/mozilla/DeepSpeech

tar -xvf tar_name

uncompress, e.g.,

tar -xvf XX.tar.gz

or compress

mv

move a file (e.g., myfile.XX) from current folder to another folder (e.g., /another_folder/), e.g.,

sudo mv myfile.XX /another_folder/

mkdir

create a new folder under current dir, e.g.,

mkdir new_folder

reboot

reboot the computer

reboot

ls

watch the existing files and folders in current folder

ls

mkdir folder_name

create a new folder in current folder, folder_name is the name of the newly create folder, e.g.,

mkdir tmp

sudo apt-get install/remove package_name

install or uninstall a package for the Ubuntu system, e.g.,

sudo apt-get install vim
sudo apt-get remove vim

sudo apt-get update/upgrade

update or upgrade the Ubuntu system, e.g.,

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install python3-pip/ python3-dev/ python-virtualenv

install pip3 and virtualenv, e,g,m

sudo apt-get install python3-pip python3-dev python-virtualenv

virtualenv -p python3.X ~/venv_folder/venv_name

create a virtualenv for a corresponding project, in venv_folder with venv_name, for python3.X, e.g.,

virtualenv -p python3.5 ~/venv/deepspeech

or

virtualenv --python==python3.5 ~/venv/deepspeech

source ~/venv_folder/venv_name/bin/activate

activate the created existing virtualenv, e.g.,

source ~/venv/deepspeech/bin/activate

python3.X -m pip install --update pip

update pip to the latest version, e.g.,

python3.5 -m pip install --update pip

python3.X -m pip install package_name

install a certain package, e.g., tensorflow

python3.5 -m pip install --upgrade link_or_path_to_tensorflow_whl_file

wget -c

download …

make

to generate .bin, e.g.,

make
sudo chmod +x XX.bin
sudo ./XX.bin

echo

watch $PATH, e.g.,

echo $PATH

expert

add an execable bin path to $PATH, e.g.,

expert PATH=/mypath/bin:$PATH

vim ~/.bashrc

add a new path permalently

vim ~/.bashrc
#在最後一行添上:
export PATH=/mypath/bin:$PATH

ps: used operations for vim
i —edit vim
esc —exit edit
:wq —save and close

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章