−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 |
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 uder@server.com'
So something
will always execute the command ssh -Y uder@server.com
.
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 user@10.50.17.66 # 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/
soft/bash.1698754992.txt.gz · Last modified: 2023/10/31 06:23 by asad