blog posts

Basic Command Codes and Linux Commands in cPanel

Accessing and working with its control panel is very important for hosting management, so in this article, we decided to talk about the main command codes and Linux commands in cPanel. Logging in to cPanel and using the main command codes in cPanel has its own rules and conditions. This training is especially suitable for those who have prepared a host with cPanel.

With basic command codes and Linux commands in cPanel, you can perform easy, complex activities; For example, it controls its security settings. Create a database and…

Easy and complex activities can be done with the main command codes in cPanel. For example, it controls its security settings. Create a database. or backed up the site. Or you can upload a file to the server. These items are only a part of the activities that can be performed with the help of the main command codes in cPanel. Of course, you must be familiar with all its instructions to be able to handle these tasks. That’s why it is necessary to learn to work with cPanel before manipulation.

 

Table of Contents

  • Access to the command line to execute the main command codes in cPanel
  • Examining the most important commands, functions, and main command codes in cPanel
  • The importance of learning and working with basic command codes in cPanel

 

Access to the command line to execute the main command codes in cPanel

Considering that WHM and cPanel perform many server management tasks automatically, familiarity with the Linux command line (CLI) can be very useful for users; In this section, how to access the command line to execute the main command codes in cPanel is given.

To access the command line, you must follow the steps below, and based on your computer’s operating system, you must use the mentioned methods:

  • Windows: select the Windows start button and type the word command line in the search box, the Windows command line will be listed at the beginning of the search results; You can click on it to open it.
  • Mac: In the dock, click the Applications icon, then the Utilities icon, and finally Terminal.
  • Ubuntu: To open the Terminal in this operating system, you must press the combination keys ctrl, alt, T.

Examining the most important commands, functions, and main command codes in cPanel

The main command codes and Linux commands in cPanel include the following, which are very important to know; Of course, for those who manage their site or server. So if you can’t work with these codes, we recommend that you leave it to a professional.

 

Check the command man $command

This command is considered the most important among other main command codes and Linux commands in cPanel. for what reason Because the “man” command helps you to read the detailed description of a command. Also see all the options and learn about the correct usage of a command. For example, the following command will help you see the documentation and applications of the rm command:

man rm

 

Check the command cat filename

With the help of this command, you can print the contents of a file among other main command codes in cPanel. or view its content on the screen. Instead of filename, you should write the path of the file that you want to view the contents of. For example, to print the contents of the filename.txt file, you must execute the following command:

cat filename.txt

 

To check the data that is currently displayed on your server console screen, you can also run the following command:

 

cat /dev/vcs1

 

Check the less filename command

To check the contents of the file, you can replace filename with the path of the file you want to view. For example, to view the contents of the filename.txt file, you can run the following command:

 

less filename.txt

 

This command can also be used to view the output of other commands using the pipe symbol (|). For example, this command can be used to view the output of the ps command. Consider the example below:

 

ps -faux|less

 

Checking the cd location command

With the help of this command, among other main command codes and Linux commands in cPanel, you can move between directories/paths. Or replace the current location with another route. For example, you can go to /usr/local/apache/ with the help of the following command:

Cd /usr/local/apache/

Checking the command chmod permissions filename

You can do significant work with the help of this command among all the main command codes in cPanel. With this command, it is possible to change the octal permissions (access level) of a file. You can change the octal permissions (access level) using a 3-digit number. You can also replace the filename with the relative path of the file whose permission (access level) you want to change. For example, to change the permission (access level) of the myfile.txt file to 755, you can run the following command:

chmod 755 myfile.txt

 

 

Check command cp file1 file2

With the help of this command, among other main command codes in cPanel, you can copy one file to another file; Basically, file 1 represents the source file. And file 2 is the file in which the contents of file 1 are to be copied. For example, to copy the contents of the original.txt file in the /copies/duplicate.txt file, you must write and execute the following command in cPanel:

cp original.txt /copies/duplicate.txt

 

Check the command du

This command is used among all the main command codes in cPanel to show the estimated amount of disk space; This refers to most of the disk space used by files or directories. You can use the -max-depth option to limit it to display subdirectories. Take a look at the following command:

du --max-depth=1

Checking the file filename command

The main commands in cPanel are amazing; One of them is this order. But what is its use? Based on the contents of a file, it guesses its type and informs you. You can replace filename with the relative path of the file you want the system to guess the type of. For example, to make the system guess the file type example.txt, you can write the following command.

file example.txt

 

Checking the grep string filename command

This command, among other main command codes in cPanel, helps to search for a specific string in a specific file and view every line that contains that string in the output. To specify a string of numbers or letters, you must enclose it in quotation marks. Additionally, you can replace filename with the relative path of the file you want to search for. For example, to search for the word/string of letters “coffee filters” in the file, you must write and execute the following command:

grep 'coffee filters' grocerylist.txt

Check command ln -s file1 file2

You can create a symbolic link through this command among other main command codes in cPanel; In other words, connect file 1 to the existing file and connect file 2 to the symbolic link file. For example, to create the file symlink-file.txt and refer it to the file /pointtome/file.txt, the following command should be used:

 

ln -s /pointtome/file.txt symlink-file.txt



The importance of learning and working with basic command codes in cPanel

When you buy a hosting virtual server, you need to have information about working with cPanel and running basic command codes in cPanel. What we discussed in this article was checking the main command codes in cPanel. These commands are basically the most common group of cPanel commands.

 

Conclusion

After buying hosting virtual servers, it is necessary to get familiar with the commands; If you need to get more information about working with cPanel, you can also refer to other content posted on Ded9 website; It is worth noting that if you intend to buy a hosting virtual server,