Linux Commands Cheat Sheet
We use SSH to connect remotely with our VMs, on cloud.
To connect we use WinSCP and Putty.
2 ways to connect to remote servers using Password, or SSH Keys.
SSH keys contain public key and private key.
ssh-keygen
nano authorized_keys
File system hierarchy standard defines the list of directories in OS.
Forward slash is root file system.
/home
/etc/nginx
/var/log
Linux is case-sensitive.
Extended file systems are used to manage the data storage on a linux file
system.
Partitions are logical volumes of the main disk.
/bin contains commands executables
Binaries are used to run different commands on a linux server.
Boot is directory where all files related to booting an OS is located.
grub is used to troubleshoot any issues with system booting.
etc, is home to configuration files, any software we install the
configuration files in in etc.
mnt, mount any external disks or usb or hard drives.
opt contains any additional software packages.
run directory contains real time process ids of services
cat /run/sshd.pid
and ps -aux | grep ssh will give the process id of ssh.
usr contains unique system resources
var contains the log files and those files that are continually updated.
sudo nano /etc/hosts, use sudo to edit hosts file
ls -la shows hidden files.
ll -tch
shows the most recently updated file on top.
w command shares details of user, system uptime.
last command shows different users working on single vm.
details of users login activity
uptime, last time when server was rebooted.
sudo cp abc.txt /opt/
mv is cut paste, cp is copy paste
sudo rm abc.txt
forecefully remove does not ask for permission, rm -fr abc.txt
top command is used to see the processes running in linux server.
ps shows the processes that are running
ps -aux shows more details of processes that are running