Bash

less than 1 minute read

This is a bash cheatsheet for all the tricks I learnt

Find out the models of the GPUs

$ lspci | grep -i --color 'vga\|3d\|2d'

Get GPUs status

$ nvidia-smi

or

$ watch nvidia-smi

htop:

$ htop

storage:

$ du

Processes handling

Check the processes running

$ ps aux | grep X 

Kill a process using its PID

$ kill -9 PID

Remote control

Find IP address

$ hostname -I

or

$ ifconfig

Copy from local to ssh

$ scp (-r) 

To visualize the GUI

$ ssh -X hostname@192.168.XXX.X

Once inside:

$ nautilus

Multiple Screens

$ tmux new -s session_name
Ctrl+b d

To reattach to a tmux session

$ tmux attach-session -t tmuxID
$ screen -S
ctrl A +D 

To reattach to a screen

$ screen -r screenID

Unzip

Unzip tar files

$ tar -xvf file.tar

Unzip tar.gz files

$ tar zxvf file.tar.gz

Other

Number of files in a repository/file

$ ls -1 | wc -l
$ wc -l <filename>

Updated: