BuycPanel Blog

BuycPanel Blog

Latest news and updates

cPanel Made Easy with This Linux Command Cheat Sheet

Posted by Jamison on 24 09 2015.

If you plan to use cPanel, there are many different Linux commands that you should know by heart. Many of these commands are commonly used in cPanel, so learning about them as early as now is going to make life easier or you. And while it is true that most users just utilize Linux’s graphical user interface, which already feature a myriad of front-ends and tools for common commands, it is still wise to equip yourself with this knowledge.

 

The main reason behind this is so that you can have a workaround in the event that the server crashes, is malfunctioning, or worst, if it fails.

 

For Information about Commands

 

There are certain commands that can be executed to get information about Linux commands. The two most common are the following:

 

	‘whatis’ – Run to get a list of command descriptions.
	‘man command’ – Run to manually display help information on the command.

 

For Displaying Files

 

Files…

If you plan to use cPanel, there are many different Linux commands that you should know by heart. Many of these commands are commonly used in cPanel, so learning about them as early as now is going to make life easier or you. And while it is true that most users just utilize Linux’s graphical user interface, which already feature a myriad of front-ends and tools for common commands, it is still wise to equip yourself with this knowledge.

 

The main reason behind this is so that you can have a workaround in the event that the server crashes, is malfunctioning, or worst, if it fails.

 

For Information about Commands

 

There are certain commands that can be executed to get information about Linux commands. The two most common are the following:

 

  • ‘whatis’ – Run to get a list of command descriptions.
  • ‘man command’ – Run to manually display help information on the command.

 

For Displaying Files

 

Files can be displayed through commands; either for those contained in the directory you are in or for those contained in another directory. The following are common Linux commands for displaying files.

 

  • ‘ls’ – Run to display all the content of the directory you are currently in.
  • ‘ls -a’ – Run to display all of the files in a directory, including those that are hidden.
  • ‘ls -l’ – Run to display all of the files, including information about size and timestamp.

 

For Uncompressing Files

 

When you need to uncompress files and you cannot do so using the tools available on the graphical user interface of Linux, you can execute specific commands to do so. The three most common commands for uncompressing files include the following:

 

  • ‘tar -zxpf’ – Run to uncompress tar.gz files.
  • ‘tar -xpf’ – Run to uncompress .tar files
  • ‘gunzip’ – Run to uncompress .gz files

 

For Other Tasks Involved with Files and Directories

 

Moving files to new files as well as renaming files and directories, creating file and directory copies, deleting files and directories, and navigating through directories can also be done through Linux commands. The following are the most commonly used commands for such tasks:

 

  • ‘cp /path/to/old /path/to/new’ – Run to create a copy of a file.
  • ‘mv /path/to/old /path/to/new’ – Run to rename a file or move it to a new file. ‘mkdir’ – Run to create a directory.
  • ‘rmdir’ – Run to delete a directory.
  • ‘rm’ – Run to delete a file.
  • ‘rm -rf’ – Run to delete an entire directory.
  • ‘cd /path/to/dir’ – Run to move a directory.
  • ‘cd ..’ – Run to move up a single directory.
  • ‘cd ~’ – Run to go to the home directory.
  • ‘cd –‘ – Run to go back to the most recently accessed directory.
  • ‘pwd’ – Run to display the current directory.
  • ‘pico’ – Run to edit a file.

 

For Displaying Stats and Details

 

To retrieve information about user and server status and details, the following commands can be used:

 

  • ‘quota’ – Run to display quota.
  • ‘uptime’ – Run to display the server’s uptime.
  • ‘uname -a’ – Run to display the stats of the operating system.
  • ‘whoami’ – Run to display user information.
  • ‘who’ – Run to display details about other users accessing the server.
  • ‘Last’ – Run to display information regarding the last login.
  • ‘whereis’ – Run to obtain information about a file’s location.
  • ‘ps -x’ – Run to display all processes you are currently running.
  • ‘ps -a’ – Run to display all processes being run.
  • ‘ps -ux’ – Run to display all running processes, including information about CPU/Memory usage.
  • ‘Top -‘ – Run to obtain overview, including details on memory usage, running processes, and server load.

 

For Service-Related Commands

 

Commands that are used to control and manage services can also be executed. The following are the most common that you should know about:

 

  • ‘service servicename restart’ – Run to restart the service.
  • ‘service servicename stop’ – Run to stop a particular service.
  • ‘service servicename start’ – Run to start or launch a service.
  • ‘service servicename status’ – Run to obtain status information on a service.

 

Learning these commands by heart, or having a hard copy of this list, can be very helpful in the event that the server experiences problems.