Linux is a powerful operating system used by millions of people around the world for server management, development and much more. Knowing the basic commands is essential for navigating effectively in a Linux environment. Here's a summary of the essential commands every beginner should know.
1. File system navigation
-
pwd: Displays the path to the current directory.Example output:
/home/user -
ls: Lists files and directories in the current directory. -
cd [path]: Changes directory. -
cd ..: Up one directory.
2. File and directory management
-
touch [filename]: Creates an empty file. -
mkdir [folder_name]: Creates a directory (folder). -
rm [file_name]: Deletes a file. -
rm -r [folder_name]: Deletes a directory and its contents. -
cp [source] [destination]: Copies a file or directory. -
mv [source] [destination]: Moves or renames a file/directory.
3. Displaying file contents
-
cat [filename]: Displays the contents of a file. -
head [filename]: Displays the first lines of a file. -
tail [filename]: Displays the last lines of a file. -
less [filename]: Navigates within a long file.
4 User management and permissions
-
whoami: Displays current user name. -
sudo [command]: Executes a command with root rights. -
chmod [permissions] [filename]: Changes file permissions. -
chown [user] [filename]: Changes the owner of a file or directory.
5. Process management
-
ps: Displays a list of running processes. -
top: Displays processes in real time. -
kill [PID]: Terminates a process (replace[PID]with the process identifier).
6. System and disk management
-
df -h: Displays available and used disk space. -
du -h [path]: Displays the size of files in a directory. -
free -h: Displays memory usage. -
uptime: Displays time since last boot and system load.
7. Network
-
``ifconfig`** : Displays network interfaces and their configurations.
-
ping [address]: Sends packets to test network connectivity. -
wget [URL]: Downloads a file from a URL.
8. Useful tips
-
man [command]: Displays a command's manual. -
history: Displays the history of previous commands.
Conclusion
This guide covers the basic Linux commands that every novice user should master. To go further, consult the manuals (man) to learn more about each command and explore the many possibilities offered by Linux.