Linux Cheet Sheet

LINUX

If you are new to programming or system administration, Linux will hunt you down and kill you if you don’t know these basic commands!

So, let’s get into it before it’s too late! ūüėą

  • Stands for Print Work Directory. This is self-explanatory, but here it goes: It prints the directory that you’re at, in case you don’t know it already.
pwd 
  • Stands for List Directory and lists the directory contents.
ls
  • Stands for Change Directory, which is the way to go to another directory.
cd
  • Creates a file without any content.
touch
  • Displays the file content.
cat
  • Copy files or directories.
cp
  • Move or rename files or directories.
mv
  • Remove files or directories.
rm
  • Create a new directory.
mkdir
  • Remove an empty directory.
rmdir
  • Display a line of text or a variable value.
echo
  • My favourite text editorūü•į.
nano
  • ¬†A powerful text editor.
vi
  • Change file or directory permissions.
chmod
  • Change file or directory owner and group.
chown
  • Search for files in a directory hierarchy.
find
  • Search text using patterns.
grep
  • Display the manual for a command.
man
  • Display information about running processes.
ps
  • Terminate processes by PID.
kill
  • Display and update sorted information about processes.
top
  • Report file system disk space usage.
df
  • Estimate file space usage.
du
  • Display memory usage.
free
  • Print system information.
uname
  • Tell how long the system has been running.
uptime
  • Display the current user if you don’t know it yet.
whoami
  • Execute a command as another user, typically the superuser.
sudo
  • Package handling utility for Debian-based distributions.
apt-get
  • Package manager for RPM-based distributions.
yum
  • Archive files.
tar
  • Package and compress (archive) files.
zip
  • ¬†Extract compressed files.
unzip
  • Retrieve files from the web.
wget
  • Transfer data from or to a server.
curl
  • OpenSSH client (remote login program).
ssh
  • ¬†Secure copy (remote file copy program).
scp
  • ¬†Remote file and directory synchronization.
rsync
  • ¬†Show or set the system’s host name.
hostname
  • Send ICMP ECHO_REQUEST to network hosts.
ping
  • Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
netstat
  • ¬†Configure a network interface.
ifconfig
  • Show/manipulate routing, devices, policy routing, and tunnels.
ip
  • Administration tool for IPv4 packet filtering and NAT.
iptables
  • Control the systemd system and service manager.
systemctl
  • Query and display messages from the journal.
journalctl
  • ¬†Schedule periodic background jobs.
crontab
  • allows us to switch to a different user and execute one or more commands in the shell without logging out from our current session
sudo su
  • Mount a file system.
mount
  • Unmount a file system.
umount

In