If you are a system administrator, then Linux commands are what you use everywhere, you know what they are for and how to use them. However, before moving on to Linux commands that will be useful for both beginners to learn and experienced network administrators to make up for forgotten, it is worth mentioning what Linux is.
Linux is an open-source operating system designed for file management. This means that any developer can take freely available system files and create their version of Linux – a distribution. Versions differ in built-in features, performance, graphical environment, support for unique programs and commands, and much more. Therefore, before downloading the system installation files from the first link in the browser, you need to figure out what exactly you need Linux for and, based on the goals, choose the appropriate version.
Linux is used in mobile devices, routers, and web servers. For example, such popular hosting panels as ISPmanager and cPanel work with Linux. Hosting control panels are needed to simplify work with the Linux control panel.
On Linux, there is no desktop in the classical sense. There is a graphical environment that is intuitive and requires a minimum of effort from the user but is not able to give everything that the system can do. The desktop for Linux is crutches, a layered program between the system and the user. To use all the advantages and capabilities of the system, you need to master the terminal, which is also called the Linux control panel.
Next, let’s go directly to the commands that are used in the Linux control panel.
Linux commands for help.
There is a lot of reference information on the Internet about Linux programs, services, and commands. But there are many distributions of the system and you cannot be completely sure that the information found on the network will work for your version of Linux. Therefore, it is useful to be able to use the built-in help system.
man, manual – user manual. The command opens a page with technical documentation on commands, built-in functions, and programs.
help – a command that works on a similar principle as the previous one, but is more practical – it displays abbreviated information about commands and expressions without detailed theoretical calculations: only a description, use cases, and additional options.
whatis – performs an end-to-end search through the system directory and displays only brief information about the command. It is convenient if we want to know the decoding of the name of a particular team.
whereis – the command allows you to find out information about the location of the program files in the system, if we do not have a graphical environment installed.
Now you know the commands that will tell you about other commands in any incomprehensible situation. This means you can get started and become a Linux user.
Linux commands for managing users and their rights.
A normal user can only store data in their folder. There are commands that a regular user cannot give to the system – he simply does not have enough rights. To do more and throughout the system, you need administrator or superuser rights.
sudo makes you a superuser with administrator rights. But keep in mind that, unlike Windows, Linux does not ask for confirmation of an action, but immediately performs it. Therefore, it is not recommended to use administrator rights until you fully understand the system, so as not to accidentally give the system a command that will break it.
useradd – registers a new user.
userdel – deletes a user’s account and files.
passwd – changes account passwords. A normal user can only change the password of their account, a superuser can change the password of any account.
Now let’s try to navigate Linux without a desktop.
Linux commands for navigating the file system.
Before you can create directories or manage files, you need to learn how to navigate the file system.
pwd is the basic command for navigating a Linux system. Shows the directory you are currently in.
ls – Displays the files and folders in the current directory.
The -l (list) option extends the basic capabilities of the ls command and adds detailed information to the list of files and folders in a directory.
cd is the basic command for moving through directories.
tab is an autocomplete command that is triggered when you double-click the Tab key.
The command can suggest roamable directories located anywhere on the system. Naturally, taking into account the rights of the user.
All these commands help to see the files, you also need to be able to manage them.
Linux commands to manage directories and files.
Let’s see how to create and delete directories and manage files in them.
mkdir – creates a folder.
rmdir, rm – both commands delete the selected directory or file, but they do it differently.
rmdir only erases empty folders – it’s good if you’re just starting to understand Linux, so you protect yourself from accidentally deleting important files.
rm destroys the entire directory with all its contents.
touch is the easiest way to create a file in Linux. You need to specify the extension so that the system understands what type of file we want to receive: a graphic, text, audio file, and so on.
cp – copies files.
mv – moves files.
Here are the basic commands for managing files and folders.
If you remember all these commands, then such management can be even more convenient and faster than on the Windows desktop.
Linux commands for managing processes.
Linux does not have a built-in task manager as Windows does. To complete a process, you must first calculate it, then identify it, and only then “kill”.
ps – lists all running processes.
If there are few processes, then it is not difficult to find the right one. But if many processes are running, then the following command comes to the rescue.
top – also shows active processes, but unlike the previous command, updates the list every 2 seconds. The updated list allows you to understand which of the processes is constantly active.
kill, killall and xkill are process killers.
Why so many – let’s figure it out.
kill kills a process by ID, a unique number that the system automatically assigns to each process.
killall terminates all processes with the same name.
The xkill command is useful if we have a graphical environment configured and we see the running program in the window. In order not to look for the program ID, run the xkill command and close the program window.
Other useful commands.
The Linux terminal has a lot of interesting things built in, and users are constantly inventing unusual ways to use common commands.
cal – built-in calendar.
history – The command will provide the last thousand commands.
Linux has long been positioned as server software and has since maintained a reputation for being difficult and inaccessible to the average user. As you can see, it is not. Understanding the structure of the system at a basic level, navigating in a virtual space without a desktop, and understanding the basic commands are quite simple and accessible to everyone.
The Linux control panel provides a lot of options once you get the hang of it. Therefore, even Windows may seem limited in functionality.