π₯οΈ Basic Linux Commands: A Beginner's Guide
πΉ Introduction
Linux commands help users interact with the operating system through the command line. Hereβs a quick guide to some of the most essential Linux commands for navigation, system information, and file management.
π System Navigation & Information Commands
π man
(Manual Pages)
Usage: Displays the manual page for a command.
man ls
πΉ Example: man pwd
will show details about the pwd
command.
π pwd
(Print Working Directory)
Usage: Displays the current directory path.
pwd
πΉ Example Output: /home/user
π ls
(List Files)
Usage: Lists files and directories in the current location.
ls
ls -l
ls -a
ls -la
πΉ Options: -l
(detailed view), -a
(show hidden files), -h
(human-readable file sizes)
π cd
(Change Directory)
Usage: Moves between directories.
cd /home/user/Documents
πΉ Example: cd ..
moves to the parent directory.
π uname
(System Information)
Usage: Shows system information.
π uname -r
(Kernel Version)
Usage: Displays the Linux kernel version.
uname
uname -r
π€ whoami
(Current User)
Usage: Prints the currently logged-in user.
whoami
π history
(Command History)
Usage: Displays previously executed commands.
history
πΉ Example: history | grep ls
will filter history for ls
commands.
π
date
(Current Date & Time)
Usage: Shows the current system date and time.
date
πΉ Example Output: Tue Feb 6 14:45:20 UTC 2025
π File & Folder Management Commands
π rmdir
(Remove Empty Directory)
Usage: Deletes an empty directory.
rmdir foldername
πΉ Example: rmdir old_folder
ποΈ rm
(Remove File)
Usage: Deletes files.
rm filename
πΉ Example: rm document.txt
π¨ rm -rf
(Force Remove)
Usage: Recursively deletes files and directories forcefully.
rm -rf foldername
πΉ Example: rm -rf /home/user/temp
β οΈ Caution: This command permanently deletes files with no recovery.
π cp
(Copy Files & Folders)
Usage: Copies files or directories.
cp source destination
πΉ Example: cp file1.txt /home/user/backup/
βοΈ mv
(Move/Rename Files & Folders)
Usage: Moves or renames files and directories.
mv oldname newname
πΉ Example: mv report.docx /home/user/Documents/
π― Conclusion
Mastering these basic Linux commands will help you efficiently manage files, navigate directories, and gather system information. Stay tuned for more advanced Linux topics! π
π Next Up: File Permissions & User Management Commands! π