Abekta

Nothing human is alien to me

User Tools

Site Tools


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 terminating
  • exit: 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:

  1. Create a private-public ssh key pair.
  2. Your private key should be inside the folder ~/.ssh/
  3. Change permission of the folder: sudo chmod -R 700 ~/.ssh
  4. 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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki