DEV Community

Arthur
Arthur

Posted on Edited on

10 Linux Commands Every Beginner Should Know for Server Management

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
Enter fullscreen mode Exit fullscreen mode

This command displays your current working directory.

For example:

/home/ubuntu
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

For additional information, use:

ls -lah
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

To return to your home directory:

cd ~
Enter fullscreen mode Exit fullscreen mode

To move one directory backward:

cd ..
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Create an empty file:

touch index.html
Enter fullscreen mode Exit fullscreen mode

You can also create multiple directories using:

mkdir -p project/logs
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

This displays disk usage in a human-readable format.

To identify which directory is consuming space:

du -sh /var/log
Enter fullscreen mode Exit fullscreen mode

Regular disk monitoring helps prevent unexpected storage problems.

6. Monitor CPU and Memory Usage

Server performance depends on available resources.

Use:

top
Enter fullscreen mode Exit fullscreen mode

This displays running processes, CPU usage, memory consumption, and system activity.

For a more detailed interactive interface, you can install and use:

htop
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

To search for a particular process:

ps aux | grep nginx
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

This checks whether your server can communicate with another network destination.

You can also check your network configuration using:

ip addr
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

To restart Nginx:

sudo systemctl restart nginx
Enter fullscreen mode Exit fullscreen mode

To start a stopped service:

sudo systemctl start nginx
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

To follow Nginx error logs:

sudo tail -f /var/log/nginx/error.log
Enter fullscreen mode Exit fullscreen mode

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)