Show Menu
Cheatography

Linux for DBA - 2 Cheat Sheet (DRAFT) by

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 connec­tions list
lsof -Pp <pi­d> (for any db process) | grep LISTEN
to find the port of the DB
netstat -ap[manca altro] | grep LISTEN
ci da anche tutte le connes­sioni enstra­blished and closed
 

Users and Auth

su <nome utente>
su - <nome utente>
sudo <nome comand­o>
w
nohup <co­man­do>
nohup <co­man­do> > <file name>

Other useful things

alias
to show all the alias
alias <co­mma­nd> <ne­w>
add a new alias to launch the command
unalias <or­iginal comman­d>
remove all alias fot the command
crontab

Services

systemctl -a
list of services and status
systemtcl start <se­rvi­ce>
start the service
systemtcl stop <se­rvi­ce>
stop the service
journalctl -fu sshd.s­ervice
see the log of a specific service
systemctl enable <se­rvi­ce-­nam­e>
systemctl enable configures the system to start the service at next reboot
systemctl disable <se­rvi­ce-­nam­e>
systemctl enable configures the system to stop the service at next reboot
systemtcl daemon­-reload
after any change to update