~5 min read • Updated Feb 18, 2026
1. Introduction
While cPanel & WHM automates many administrative tasks, understanding basic Linux commands helps users manage files, troubleshoot issues, and interact with their server more efficiently. This guide covers essential commands and examples to help you get started.
2. Common Linux Commands
To run a command, type it into the CLI and press Enter. Replace FILENAME or LOCATION with your actual paths.
| Command | Description | Example |
|---|---|---|
cat FILENAME |
Prints the contents of a file. | cat filename.txt |
cd LOCATION |
Navigate between directories. | cd /usr/local/apache/ |
chmod permissions FILENAME |
Change file permissions. | chmod 755 myfile.txt |
chown USER:GROUP FILENAME |
Change file ownership. | chown user:group file.txt |
cp FILE1 FILE2 |
Copy a file. | cp original.txt /copies/duplicate.txt |
du |
Show disk usage. | du |
file FILENAME |
Detect file type. | file filename |
grep string FILENAME |
Search for text inside a file. | grep 'example text' file.txt |
last |
Show recent logins. | last |
ln -s file1 file2 |
Create a symbolic link. | ln -s /path/file1.txt link.txt |
ls |
List files and directories. | ls |
ls -al |
View hidden files and details. | ls -al |
more FILENAME |
View file contents page by page. | more filename.txt |
netstat |
List network connections. | netstat |
pico FILENAME |
Edit a file using pico. | pico file.txt |
ps |
Show running processes. | ps |
rm FILENAME |
Delete a file. | rm trash.txt |
tail -## FILENAME |
Show last lines of a file. | tail -20 file.txt |
touch FILENAME |
Create an empty file. | touch example.txt |
vi FILENAME |
Edit a file using vi. | vi file.txt |
w |
Show logged‑in users. | w |
wc FILENAME |
Count words in a file. | wc file.txt |
whereis NAME |
Locate installed applications. | whereis perl |
3. Running Multiple Commands on One Line
|— Pipe output from one command to another>— Overwrite or create a file>>— Append to a file<— Use a file as input
Examples
grep User /usr/local/apache/conf/httpd.conf | morelast -a > /root/lastlogins.tmpmysql --skip-column-names --batch -e 'show processlist' | wc -lnetstat -an | grep :80 | wc -ltail -10000 /var/log/exim_mainlog | grep 'example\.com' | more4. Common Configuration Files and Directories
| Service | Locations |
|---|---|
| Exim | /etc/exim.conf /var/log/exim_mainlog /var/log/exim_rejectlog /etc/valiases/ /etc/vfilters/ /home/username/.forward |
| MySQL | /root/.my.cnf /etc/my.cnf /var/lib/mysql/ |
| ProFTPD | /etc/proftpd.conf /var/log/xferlog /etc/proftpd/ |
| SSH | /etc/ssh/sshd_config |
| System | /var/log/messages /var/log/dmesg |
Conclusion
Learning essential Linux commands helps you manage your server more effectively, troubleshoot issues faster, and understand how cPanel & WHM interacts with the underlying operating system.
Written & researched by Dr. Shahin Siami