ะ˜ะทะพะฑั€ะฐะถะตะฝะธะต ะฟะพัั‚ะฐ

Linux Team's Must-Have: The Complete Guide for Beginners and Pros


Overview of Basic Linux Commands


Linux is one of the most popular operating systems in the world, especially among developers and system administrators. Basic Linux commands allow you to manage files, processes, system settings, and perform many other tasks. In this article, we will review the most important commands, their syntax, and practical applications.


Working with Files and Directories


Commands for managing files and folders are some of the most frequently used in Linux. They allow creating, deleting, copying, moving, and viewing contents.


ls

The ls command displays a list of files and folders in the current directory. You can use various options, for example, -l for detailed information about files, or -a to show hidden files.


pwd

The pwd command outputs the current working directory, i.e., the path to the folder you are currently in.


cd

The cd command is used to change the current directory. For example, cd /home/user/Documents will take you to the Documents folder.


mkdir

Creates a new directory. For example, mkdir my_folder will create a folder named my_folder.


rm

Deletes files or directories. For example, rm file.txt will delete the file. To delete a folder with its contents, use rm -r folder_name.


cp

Copies files or directories. For example, cp file.txt /home/user/backup/ will copy the file to another folder.


mv

Moves or renames files and folders. For example, mv old_name.txt new_name.txt will rename the file.


Viewing File Contents


To quickly view file contents, use the commands:


cat

Displays the content of a file on the screen. For example, cat file.txt.


less

Allows viewing the file page by page and searching within the file. Useful for large files.


head

Displays the first lines of a file. You can specify the number of lines with the -n option, for example, head -n 20 file.txt.


tail

Displays the last lines of a file. Similarly, you can specify the number of lines, for example, tail -n 20 file.txt.


Process Management


Managing running processes includes viewing, stopping, and starting new tasks.


ps

Displays a list of current processes. For example, ps aux shows all running processes.


top

An interactive tool for monitoring processes in real time. Shows CPU usage, memory, and other parameters.


kill

Sends a signal to a process to terminate it. For example, kill -9 PID forcibly terminates the process with the specified PID.


pkill

Allows terminating processes by name. For example, pkill firefox will terminate all Firefox processes.


Managing Access Rights


Commands chmod, chown, and chgrp are used to manage access to files and folders.


chmod

Changes permissions. For example, chmod 755 script.sh sets execute and read permissions for the owner, and read-only for others.


chown

Changes the owner of a file or folder. For example, chown user:user file.txt.


chgrp

Changes the group of a file. For example, chgrp staff file.txt.


Package Management


Managing software is done through package managers. Different commands are used depending on the distribution.


For Debian/Ubuntu-based systems:


apt-get

Installing a package: sudo apt-get install package_name


Updating the package list: sudo apt-get update


Upgrading the system: sudo apt-get upgrade


For Red Hat/CentOS-based systems:


yum

Installing a package: sudo yum install package_name


Updating the system: sudo yum update


Working with Archives and Archivers


Commands for compression and decompression of files:


tar

Create an archive: tar -cvf archive.tar folder/


Extract an archive: tar -xvf archive.tar


zip

Create an archive: zip archive.zip file1 file2


unzip

Extract an archive: unzip archive.zip


Network Operations


Commands for diagnosing network issues and configuration:


ping

Checks the availability of a host on the network. For example, ping google.com.


ifconfig

Displays network interface configuration. In newer systems, it is recommended to use ip addr.


netstat

Displays active connections and ports. In newer systems, it is replaced by ss.


ssh

Securely connects to a remote server: ssh user@host.


Conclusion


Linux commands provide a powerful toolkit for system management, task automation, and file handling. Mastering basic commands significantly increases work efficiency and helps better understand internal OS processes. Regular practice and exploring additional command features will make you a more confident Linux user.


Author: Mikhail Shcherbakov
Published:
Last updated:
Views: 27