Essential Commands
ls
: List the contents of the current directorycd
: Change directorypwd
: Print the working directorymkdir
: Create a new directoryrmdir
: Remove a directorycp
: Copy a filemv
: Move a filerm
: Remove a filenano
: Open a text editorcat
: Concatenate filesgrep
: Search for patterns in filessudo
: Run a command as another user
File and Directory Permissions
chmod
: Change the permissions of a file or directorychown
: Change the owner of a file or directorychgrp
: Change the group of a file or directory
Processes
ps
: List all running processestop
: Display a real-time list of running processeskill
: Terminate a running process
Networking
ping
: Send a ping request to a hostifconfig
: Display information about network interfacestraceroute
: Trace the route to a host
Other Useful Commands
man
: Display the manual page for a commandhistory
: Display a list of recently executed commandsclear
: Clear the terminal screen
System Administration
apt-get
: Install, remove, and update software packagesyum
: Install, remove, and update software packages (Red Hat and CentOS)dnf
: Install, remove, and update software packages (Fedora)systemctl
: Control system services
Troubleshooting
dmesg
: Display kernel messagesstrace
: Trace the system calls made by a processltrace
: Trace the library calls made by a process
Tips and Tricks
Use the
Ctrl
+R
shortcut to search through your command history.You can use the
sudo
command to run commands as another user. This is useful for performing administrative tasks.Use the
man
command to read the manual page for a command. This is a great way to learn more about how to use a command and its options.You can use the
|
(pipe) character to chain commands together. This allows you to output the results of one command to the input of another command.You can use the
>
(redirect) character to redirect the output of a command to a file.