Table of Contents
This is an old revision of the document!
Bash
Function | Code |
---|---|
Check storage | df -h |
System usage monitor | htop |
CPU information | lscpu |
Check drives | lsblk |
Check GPU | sudo lshw -C display / lspci | grep -e VGA |
Ports
To kill everything listening to a port: sudo fuser -k 2121/tcp
Profile
Create a hidden file called .bashrc
in your home folder and add aliases for different commands as:
alias something='ssh -Y [email protected]'
So something
will always execute the command ssh -Y [email protected]
.
Screen
screen -S name screen -ls screen -d -r name
Detach screen from another ssh shell: screen -d -r
Keyboard shortcuts:
ctrl+a d
: leaving a screen without terminatingexit
: to terminate a screen
Server
ssh -Y [email protected] # login ssh -N -f -L localhost:8889:localhost:8889 user@address # tunneling
Login to server using private key:
- Create a private-public ssh key pair.
- Your private key should be inside the folder
~/.ssh/
- Change permission of the folder:
sudo chmod -R 700 ~/.ssh
- Then log in:
ssh -Y username@server
Users and Groups
sudo adduser username sudo deluser username sudo addgroup groupname sudo delgroup groupname sudo adduser username groupname getent passwd | cut -d: -f1 getent group
Storage
sudo mount -t auto /dev/sdb /media/plato/
GPU
sudo apt autoremove nvidia* --purge sudo /usr/bin/nvidia-uninstall sudo /usr/local/cuda-X.Y/bin/cuda-uninstall sudo apt update sudo apt upgrade lspci | grep -e VGA ubuntu-drivers devices sudo ubuntu-drivers autoinstall reboot nvidia-smi
soft/bash.1698756477.txt.gz · Last modified: 2023/10/31 06:47 by asad