Hello, I'm Arthur. Linux is one of the most widely used operating systems for managing web servers, cloud infrastructure, and development environments.
If you're planning to work with VPS hosting or manage your own server, learning basic Linux commands is an important first step.
You don't need to be an expert to get started. Understanding a few essential commands can help you navigate files, monitor resources, manage processes, and troubleshoot common server problems.
Let's explore 10 useful Linux commands with practical examples.
1. Check Your Current Directory
When working through a Linux terminal, it's important to know where you are.
Use:
pwd
This command displays your current working directory.
For example:
/home/ubuntu
It helps you avoid creating or editing files in the wrong location.
2. List Files and Directories
The ls command displays files and folders in your current directory.
ls
For additional information, use:
ls -lah
This displays hidden files, file permissions, ownership, and file sizes in a readable format.
It's particularly useful when managing server directories.
3. Navigate Between Directories
Use cd to move between directories.
For example:
cd /var/www
To return to your home directory:
cd ~
To move one directory backward:
cd ..
These commands make it easier to navigate Linux file systems.
4. Create Files and Directories
Linux provides simple commands for creating files and directories.
Create a directory:
mkdir my-project
Create an empty file:
touch index.html
You can also create multiple directories using:
mkdir -p project/logs
The -p option creates parent directories when necessary.
5. Check Disk Space
Running out of disk space can affect websites, databases, and applications.
Use:
df -h
This displays disk usage in a human-readable format.
To identify which directory is consuming space:
du -sh /var/log
Regular disk monitoring helps prevent unexpected storage problems.
6. Monitor CPU and Memory Usage
Server performance depends on available resources.
Use:
top
This displays running processes, CPU usage, memory consumption, and system activity.
For a more detailed interactive interface, you can install and use:
htop
These tools help identify processes that may be slowing down your server.
7. Check Running Processes
Sometimes, an application continues running in the background even after you close its terminal session.
To list running processes:
ps aux
To search for a particular process:
ps aux | grep nginx
This is useful when troubleshooting services and applications.
8. Check Network Connectivity
Network problems can cause websites and applications to become inaccessible.
Use:
ping google.com
This checks whether your server can communicate with another network destination.
You can also check your network configuration using:
ip addr
These commands are helpful when investigating connectivity issues.
9. Manage Linux Services
Linux servers often run services such as Nginx, Apache, and MySQL.
You can check a service's status with:
sudo systemctl status nginx
To restart Nginx:
sudo systemctl restart nginx
To start a stopped service:
sudo systemctl start nginx
Always check the service status after making changes.
10. View Server Logs
Logs help administrators understand what happened when an application or service experienced an error.
For example, to view recent system logs:
journalctl -n 50
To follow Nginx error logs:
sudo tail -f /var/log/nginx/error.log
Reading logs is one of the most useful troubleshooting skills for Linux administrators.
Where Can You Practice Linux Commands?
The best way to learn Linux is through practical experience.
You can start with a local virtual machine or a Linux VPS. Having your own Linux environment allows you to practice file management, install applications, configure services, and monitor system resources.
If you want a remote Linux environment for development and server administration, HelloServer VPS Hosting is worth exploring.
For more demanding computing tasks, such as AI development, deep learning, and GPU-based workloads, you can also explore HelloServer GPU Dedicated Servers.
Final Thoughts
Learning Linux commands doesn't happen overnight, but consistent practice makes server management much easier.
Start with basic navigation and file management, then move toward monitoring resources, managing services, and troubleshooting logs.
These 10 commands provide a useful foundation for anyone interested in Linux administration, VPS management, or DevOps.
The more you practice, the more comfortable you'll become working directly from the terminal.
Top comments (0)