Basic Linux Commands

I learned these Linux commands.
Linux Commands Cheat sheet
Here's a most commonly used Linux commands:
Navigation
pwd
: Print the current working directoryls
: List files and directories in the current directorycd <directory>
: Change the current working directory to the specified directory
File Management
touch <file>
: Create a new, empty filecat <file>
: Display the contents of a filecp <source> <destination>
: Copy a file or directorymv <source> <destination>
: Move or rename a file or directoryrm <file>
: Remove (delete) a filerm -r <directory>
: Remove a directory and its contents recursively
Directory Management
mkdir <directory>
: Create a new directorymkdir -p <directory/subdirectory>
: Create a directory hierarchy
Process Management
ps
: List running processestop
: Display real-time information about running processeskill <PID>
: Terminate a process by its process ID (PID)
System Information
uname -a
: Display information about the operating systemdf -h
: Display available disk spacefree -h
: Display available memory
Command History
history
: Display the command history!!
: Repeat the last command!<command>
: Repeat the most recent command starting with the specified text
Helpful Tips
Use the
Tab
key for auto-completion of file and directory namesCtrl+C
to terminate the current processCtrl+L
to clear the terminal screen
This is just an overview of the basic Linux commands. There are many more commands available. So keep exploring and learning!
Subscribe to my newsletter
Read articles from Ayesha Saher directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
