Linux is one of the operating systems that form the backbone of modern technology. However, while it is a powerful operating system, it may seem complex and hard to understand for many people. In this article, you will discover the basic commands and system administration tips you'll need as you step into the world of Linux.
Linux is an open-source and free operating system. Initially developed by Linus Torvalds in 1991, this system is continuously updated and developed by developers around the world. It has a wide range of uses, from servers to smart devices, supercomputers to IoT devices. Linux's flexibility, security, and community support make it attractive to many users.
The terminal is the heart of Linux and allows you to interact with the command line. Using the terminal may seem a bit intimidating at first, but once you master it, you can control your system more effectively and quickly.
You can usually open the terminal by pressing the "Ctrl + Alt + T" shortcut. Once the terminal is open, you'll see a command line where you can type your commands. First, you can use the 'pwd' command to find out which directory you're in.
pwd
This command stands for "print working directory" and shows the path of the directory you're currently in.
File and directory management in Linux is crucial for organizing the data on your system. Here are some basic commands:
ls
: Used to list the files and directories in the current directory.cd
: Allows you to navigate between directories. For example, 'cd /home/user' will take you to the user directory.mkdir
: Creates a new directory. For example, 'mkdir new_directory' will create a directory named 'new_directory'.rm
: Used to remove files or directories. To remove a directory, use the '-r' flag, like 'rm -r directory_name'.cp
: Used to copy files or directories. For example, 'cp file1 file2' will copy 'file1' to 'file2'.mv
: Used to move or rename files or directories. For example, 'mv old_file new_file' will rename 'old_file' to 'new_file'.Linux system administration requires the ability to monitor and manage system resources. Here are some advanced commands for system information and monitoring:
top
: Monitors running processes and resource usage in real-time on your system.df
: Shows disk space usage. Use 'df -h' to display it in a human-readable format.free
: Displays memory (RAM) usage. Use 'free -m' to show RAM usage in megabytes.ps
: Lists running processes. 'ps aux' will list all processes for all users in detail.uptime
: Shows how long the system has been running and its load averages.File permissions in Linux determine who can access files and directories. Understanding permissions is critical for system security.
Every file and directory has specific permissions. These permissions are divided into three main groups: user (owner), group, and others. Permissions are represented as read (r), write (w), and execute (x).
You can view file permissions using the ls -l
command. To change permissions, you use the chmod
command. For example, to give everyone read permission on a file, you would use chmod o+r filename
.