Ubuntu Terminal commands

Ubuntu commands

    • htop
    • nvidia-smi
    • git clone
    • tar -xvf tar_name
    • mv
    • mkdir
    • reboot
    • ls
    • mkdir folder_name
    • sudo apt-get install/remove package_name
    • sudo apt-get update/upgrade
    • sudo apt-get install python3-pip/ python3-dev/ python-virtualenv
    • virtualenv -p python3.X ~/venv_folder/venv_name
    • source ~/venv_folder/venv_name/bin/activate
    • python3.X -m pip install --update pip
    • python3.X -m pip install package_name
    • wget or curl
    • make
    • echo
    • expert
    • vim ~/.bashrc
    • find
    • sh

htop

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

htop

Ubuntu Terminal commands_第1张图片
or use: top

top

nvidia-smi

watch Gpu occupatation

nvidia-smi

or watch Gpu per 10 seconds

watch -n 10 nvidia-smi

Ubuntu Terminal commands_第2张图片

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.,

mv myfile.XX /another_folder/

or rename a file, e.g.,

mv a.jpg tmp.jpg.bak

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

watch installed python

ls /usr/bin/python*
ls /usr/local/bin/python*

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 or curl

download …

wget -c …
curl …

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

find

find files, of a certain type (e.g., wav), and create file lists, e.g.,

find XXX_pathfolder -name “*.wav” > filelist.txt

if add content to a filelist file, change > to >>
if list all files and folders under a folder:

ls > filelist.txt

sh

sh ./run.sh

creating sh file for commands is convenient

train_file=filelist.txt
path=/tmp/test
find $path -name “*.wav” > $train_file

你可能感兴趣的:(Ubuntu,Python)