Cheatography
https://cheatography.com
Linux command medium level, start with database related commands
This is a draft cheat sheet. It is a work in progress and is not finished yet.
FileSystem Operations
df -h |
Shows all filesystem |
mount |
mount a Volume |
unmount |
hide the Volume |
lsblk |
map of the filesystem |
dmsetup ls |
display unique number for any volume |
Logical Volume Manager
pv create |
create a logical volume from physical v. |
pvs |
display Physical v. list |
lvs |
display logical v. |
pvt |
IDK |
lvresize |
increase memory of a logical, -r physical increaze. |
Connection
netstat -a |
active connections list |
lsof -Pp <pid> (for any db process) | grep LISTEN |
to find the port of the DB |
netstat -ap[manca altro] | grep LISTEN |
ci da anche tutte le connessioni enstrablished and closed |
|
|
Users and Auth
su <nome utente> |
su - <nome utente> |
sudo <nome comando> |
w |
nohup <comando> |
nohup <comando> > <file name> |
Other useful things
alias |
to show all the alias |
alias <command> <new> |
add a new alias to launch the command |
unalias <original command> |
remove all alias fot the command |
crontab |
Services
systemctl -a |
list of services and status |
systemtcl start <service> |
start the service |
systemtcl stop <service> |
stop the service |
journalctl -fu sshd.service |
see the log of a specific service |
systemctl enable <service-name> |
systemctl enable configures the system to start the service at next reboot |
systemctl disable <service-name> |
systemctl enable configures the system to stop the service at next reboot |
systemtcl daemon-reload |
after any change to update |
|