Today, I will be with you with Comprehensive Linux VPS Commands From A to Z. I wish you read and enjoy this post to learn some of Linux Commands together.
Learning Linux Commands in a comprehensive way is the first and most important step you should take as a server administrator in learning and mastering Linux
Unlike Windows operating systems, Linux has very powerful flexibility in using server-side commands, so that a fully professional Linux server can be managed remotely without the need for a graphical environment, which will be impossible or very very difficult for Windows.
We try to update this article regularly at specified times with new commands so that at the end of a user’s Linux instruction, there is no need to search for specific commands in search engines or other websites, so visit this page regularly.
You can use these commands in your local Linux system or you can order for a Linux VPS and do these tests on it.
Basic Linux Command Tutorials Part 1
In Linux, everything is subdivided into a series of files and directories. The directory structure (the same folders as Windows) in Linux is an inverted tree as you can see in the picture below
Each directory contains a series of directories and other important system files that perform essential Linux tasks.
By knowing the Linux commands, you will be able to execute specialized operations on these sections or install and run specific services on Linux.
Getting Started with Linux OS Starts with a Linux installation tutorial, and our recommendation is to have a full-fledged Linux instruction tutorial, followed by a specialized training course for Linux administrators in the future.
We will try to give you every example of the instruction we use to give you a clear example of how to use it in Windows so that you can understand the functionality of each command perfectly.
One of the first things you need to know in Linux is how to open files, you open the file in Windows by double-clicking on the item you want, and in Linux, this can be done with the cat command. First, we write the cat command and then we enter the path of the corresponding file.
cat /etc/passwd cat /proc/meminfo
If you want to get accurate information about your Linux server, check out the following commands
cat /proc/cpuinfo cat /proc/meminfo cat /proc/swaps
The first command shows CPU information and the number of cores, the second command shows RAM (Random Access Memory) Details and the third command shows information about the amount of SWAP file.
If you want to see the date and time set on your server, the date and time output can be obtained with the date command.
You can use the following command to display all the slots connected to the system (just to remind: slots are like card-mounted hardware that are installed at specific locations on the server, such as a graphics card in the case of personal systems).
The following statement is also used to display the number of USB-type hardware connected to Linux, such as when you check the number of USB-connected USBs on my computer.
You can use the following command to get information about the distribution and version of the kernel or Linux kernel.
You can also use the following command to set the clock on the server bios.
In Linux for more information on each command as well as how to use the switches, use the pre-command man commands and read the user guide exactly to get very detailed information about the command.
For example, we would like to get the cat command prompt as follows in the command line environment.
It was the finish of the first section of our topic, stay with me with the next section.
Basic Linux Command Tutorials Part 2
In this section, we are going to explain a series of hardware management commands that can help you control the status of your server on, off and off.
The first command is init that allows you to change the way the server operates. 6 mods are defined for this command.
Mode 0 mod to bring the system to shutdown mode.
Mode 1 is a single-user and it is usually used for recovery.
Mode 2 mod is for multi-user.
Mode 3 mod is for multi-user with networking.
Mode 4 mod is unused and undefined.
Mode 5 mod is the graphical mode of the system.
Mode 6 is bringing Linux to reboot is like when you enter a reboot command.
init 0 init 1 init 2 init 3 init 5 init 6
The next is the logout command, which acts like when you log out graphically from Windows.
The reboot command does exactly the same as restarting in Windows.
The shutdown command also shuts down the system, but if used with other switches it could perform a different function, for example, it would reboot the system.
shutdown -r now
Let’s take a good look at the Linux command line management and control of directories in Linux to see how we can work with directories.
The first command is one of the most important and most commonly used that is the cd command, which is the abbreviation for the words change directory, which means you should use this command when you want to move from one path to another directory on Linux.
In the following command, wherever we are, Linux will enter the home directory with this command. Maybe you have a question about what this directory is for. I should say that this directory holds information about each user.
Sometimes it is necessary to change the information of a user group such as its name. For this purpose, a groupmod command has been set which you can use in the following format.
groupmod -n Testgroup OperaVPS
In the command above we changed the group name from Testgroup to OperaVPS.
The next most common command is the passwd command, which can change the password of each user. If you enter the ssh area with root access and enter this command only; The password will obviously be changed by the relevant user.
The last important command is to add the user to the server, which I also used the most complete switches that I will explain to you later.
useradd -c “comment here” -g adm -d /home/user -s /bin/bash user
We define a comment by the c switch for the username, which of course is not necessary, we associate the username to its froup using g switch, and we specify the location of each username with d switch, and s switch defines the shell that user should use.
Now we want to deal with file management commands in this section, we can use the following command to change the group of a file.
chgrp adm file
We change the file to the adm user group by the command above.
The next most important and useful command is the chmod command. This command can change the permissions of any file or directory. Here are the three symbols that you must learn for this command.
r means to read with number 4
w means to write with number 2
x means to execute with number 1
The next command is chown stands for change owner, each file or directory is assigned to one owner and a group. You can change these two by the following command.
chown root:root file
If you want to change the owner of all the files or directories in the directory you want to use, use the -R switch as below.
chown –R root:root directory
Compress and unzip files.
To extract .bz2 compressed files, you can use bunzip2 as follows.
You can use the following command to compress a file with the bzip2 extension.
To unzip the file with the .gz extension, you can use the following command.
The following command is used to compress the file with the .gz extension.
You can use the following command to compress a file with the maximum compression.
gzip -9 file
To compress a file with a rar extension you can also enter the following format.
rar a file.rar file
You can also enter the following command to unzip a file.
rar x file.rar
Create an uncompressed .tar file.
tar -cvf archive.tar file
To unzip a .tar.gz file. You can use the following command.
tar -xvfz archive.tar.gz
You can use the following command to uncompress a .zip file.
This was the finish of the Fourth Part Of Linux Command Tutorials.
This post will be updated every week.