• Email: [email protected]
  • Dedicated Server Login
  • About
  • 9288041031
  • Knowledge Base
  • Support
India's best web hosting | Ehostpiya India
  • Home
  • Hosting
    Web Hosting Quality Hosting Starting at ₹60/mo
    Cloud VPS Starting at ₹300/mo
    Dedicated Server First Starting at ₹2401/mo
    Reseller Web Hosting Conveniently Starting at ₹421/mo
    Application For Hosting
    • iconWordPress Hosting
    • iconJoomla Hosting
    • iconMagento Hosting
    • iconOpencart Hosting
    • iconPrestashop Hosting
    • iconDrupal Hosting
  • Email
  • Domain
  • SVG
    Contact Us Face any problem contact with us
    SVG
    About Us We are leading hosting company
  • My Account
Web Hosting Blogs by Ehostpiya | Tips and Tricks Web Hosting Blogs by Ehostpiya | Tips and Tricks
Buy Now

Archives

  • October 2026
  • September 2026
  • August 2026
  • October 2023

Categories

  • Control Panels
  • Magento
  • Miscellaneous
  • SEO
  • Technology
  • Trends
  • Web Hosting
  • Wordpress
Facebook Twitter Instagram Pinterest
Home Linux Useful Commands: A Practical Guide for Beginners and Hosting Users
Linux Useful Commands Linux Useful Commands
ByVandeeta
August 12, 2026

Linux Useful Commands: A Practical Guide for Beginners and Hosting Users

Table of Contents

Toggle
  • Linux Useful Commands: A Practical Guide for Beginners and Hosting Users
    • 1. pwd — Show Current Directory
    • 2. ls — List Files and Directories
    • 3. cd — Change Directory
    • 4. mkdir — Create a Directory
    • 5. touch — Create a File
    • 6. cp — Copy Files and Directories
    • 7. mv — Move or Rename Files
    • 8. rm — Remove Files
    • 9. cat — Display File Contents
    • 10. less — Read Large Files
    • 11. head — View the Beginning of a File
    • 12. tail — View the End of a File
    • 13. grep — Search for Text
    • 14. find — Locate Files
    • 15. du — Check Disk Usage
    • 16. df — Check Available Disk Space
    • 17. free — Check Memory Usage
    • 18. top — Monitor Running Processes
    • 19. ps — View Running Processes
    • 20. kill — Stop a Process
    • 21. chmod — Change File Permissions
    • 22. chown — Change File Ownership
    • 23. tar — Create and Extract Archives
    • 24. wget — Download Files
    • 25. curl — Test URLs and APIs
    • 26. ping — Test Network Connectivity
    • 27. ss — Check Network Connections
    • 28. ip — View Network Information
    • 29. dig — Check DNS Records
    • 30. systemctl — Manage Services
    • 31. journalctl — View System Logs
    • 32. ssh — Connect to a Remote Server
    • 33. whoami — Identify the Current User
    • 34. sudo — Run Commands With Elevated Privileges
  • Useful Linux Commands at a Glance
    • Final Thoughts

Linux Useful Commands: A Practical Guide for Beginners and Hosting Users

Linux is widely used to power web servers, VPS machines, cloud platforms, and hosting environments. One of its biggest advantages is the command line, which allows administrators to manage files, monitor resources, install software, configure services, and troubleshoot problems quickly.

Whether you are managing a VPS, dedicated server, or Linux-based web hosting environment, learning a few essential commands can make server administration much easier.

1. pwd — Show Current Directory

The pwd command displays the full path of the directory you are currently working in.

pwd

Example output:

/home/user/public_html

This is especially useful when working with multiple directories and you want to confirm your current location.


2. ls — List Files and Directories

Use ls to view files and folders in the current directory.

ls

For more detailed information:

ls -lah

This displays file permissions, ownership, size, and hidden files in a human-readable format.


3. cd — Change Directory

The cd command allows you to move between directories.

cd /var/www

Move one directory backward:

cd ..

Return to your home directory:

cd ~

4. mkdir — Create a Directory

Create a new folder using:

mkdir website

To create several levels of directories at once:

mkdir -p projects/mywebsite/files

5. touch — Create a File

The touch command can create an empty file.

touch index.html

It can also update a file’s timestamp if the file already exists.


6. cp — Copy Files and Directories

Copy a file:

cp index.html backup.html

Copy a directory and its contents:

cp -r website website-backup

Always double-check the destination when copying important server files.


7. mv — Move or Rename Files

Rename a file:

mv old.html new.html

Move a file to another directory:

mv index.html /var/www/html/

The mv command is useful for both moving and renaming files.


8. rm — Remove Files

Delete a file:

rm oldfile.txt

Remove an empty directory:

rmdir oldfolder

To remove a directory and its contents:

rm -r oldfolder

Be careful with rm. Deleted files may not be recoverable through the command line.


9. cat — Display File Contents

The cat command displays the contents of a text file.

cat config.txt

It can be useful for quickly checking configuration files, logs, and scripts.


10. less — Read Large Files

For large files, less is often more convenient than `cat.

less /var/log/syslog

You can scroll through the file without loading the entire contents into a single terminal display.

Press q to exit.


11. head — View the Beginning of a File

Display the first lines of a file:

head access.log

To display the first 20 lines:

head -n 20 access.log

12. tail — View the End of a File

The tail command is particularly useful for checking recent log entries.

tail error.log

To continuously monitor a log:

tail -f error.log

This is extremely useful when troubleshooting a website while reproducing an error.


13. grep — Search for Text

Search for a specific word or phrase:

grep "error" error.log

For a case-insensitive search:

grep -i "error" error.log

You can also search recursively through directories:

grep -R "database" /var/www/

14. find — Locate Files

Find a file by name:

find /var/www -name "index.php"

Find all PHP files:

find /var/www -name "*.php"

This command is useful when you know what you are looking for but not where it is stored.


15. du — Check Disk Usage

To see how much space a directory uses:

du -sh /var/www

To identify large directories:

du -h --max-depth=1

This can help locate websites, backups, or log files consuming excessive disk space.


16. df — Check Available Disk Space

The df command shows filesystem storage usage.

df -h

The -h option displays sizes in an easier-to-read format such as GB and MB.

If a server is running out of disk space, df -h is one of the first commands worth checking.


17. free — Check Memory Usage

View RAM usage with:

free -h

It provides information about used, available, and cached memory.

This can help identify whether a VPS is experiencing memory pressure.


18. top — Monitor Running Processes

The top command provides a live view of processes and system resource usage.

top

It can help identify processes consuming significant CPU or memory.

On systems where it is installed, htop provides a more interactive alternative:

htop

19. ps — View Running Processes

Display currently running processes:

ps aux

Search for a particular process:

ps aux | grep nginx

This is useful when checking whether a particular application or service is running.


20. kill — Stop a Process

If a process becomes unresponsive, you can terminate it using its process ID:

kill 1234

If a process does not respond to a normal termination request, administrators may use:

kill -9 1234

Use forceful termination carefully because it does not give the application an opportunity to shut down gracefully.


21. chmod — Change File Permissions

Linux uses permissions to control who can read, modify, or execute files.

For example:

chmod 644 index.php

For a directory:

chmod 755 public_html

Incorrect permissions can cause website errors, so permissions should be changed carefully rather than simply making everything writable.


22. chown — Change File Ownership

Change ownership of a file:

chown user:user index.php

For a directory and its contents:

chown -R user:user public_html

Incorrect ownership can prevent web applications from reading or writing required files.


23. tar — Create and Extract Archives

Create a compressed archive:

tar -czf website-backup.tar.gz public_html/

Extract an archive:

tar -xzf website-backup.tar.gz

tar is commonly used for website backups and transferring groups of files.


24. wget — Download Files

Download a file from a URL:

wget https://example.com/file.zip

It is useful for downloading software packages, backups, and other files directly from a server.

Only download files from sources you trust.


25. curl — Test URLs and APIs

curl is a versatile networking utility.

Check a website:

curl -I https://example.com

The -I option retrieves HTTP headers, making it useful for checking response codes and server headers.

For example, you might see:

HTTP/2 200

A redirect might return a 301 or 302, while a missing page may return 404.


26. ping — Test Network Connectivity

Test connectivity to a host:

ping example.com

It can help determine whether a host is reachable over the network.

Note that some servers block ICMP traffic, so a failed ping does not necessarily mean the website is offline.


27. ss — Check Network Connections

View listening ports:

ss -tuln

This can help identify which network services are listening on the server.

For example, web servers commonly listen on ports such as 80 for HTTP and 443 for HTTPS.


28. ip — View Network Information

Display network interfaces and IP addresses:

ip addr

View routing information:

ip route

The ip command is commonly used for modern Linux network configuration and troubleshooting.


29. dig — Check DNS Records

Query DNS information:

dig example.com

Check a specific record type:

dig example.com MX

This is particularly useful when troubleshooting domain and DNS problems.


30. systemctl — Manage Services

On systems using systemd, systemctl is commonly used to manage services.

Check a service:

systemctl status nginx

Restart a service:

systemctl restart nginx

Start a service:

systemctl start nginx

Enable a service at boot:

systemctl enable nginx

Always verify the service name on your particular Linux distribution.


31. journalctl — View System Logs

journalctl allows administrators to inspect logs managed by systemd.

View recent messages:

journalctl -n 50

View logs for a particular service:

journalctl -u nginx

This can be extremely helpful when a service refuses to start or repeatedly crashes.


32. ssh — Connect to a Remote Server

Secure Shell (SSH) allows you to connect to a remote Linux server.

ssh username@server-ip

After authentication, you can manage the remote server through the terminal.

For security, use strong authentication practices and avoid exposing unnecessary SSH access to the public internet.


33. whoami — Identify the Current User

Find out which Linux user you are currently logged in as:

whoami

This is useful when working with permissions and administrative commands.


34. sudo — Run Commands With Elevated Privileges

Some administrative operations require elevated privileges.

sudo systemctl restart nginx

Linux may ask for your account password depending on the system’s configuration.

Use sudo carefully because administrative commands can modify critical server components.


Useful Linux Commands at a Glance

CommandMain Purpose
pwdShow current directory
lsList files
cdChange directory
mkdirCreate directory
touchCreate file
cpCopy files
mvMove or rename files
rmDelete files
catDisplay file contents
grepSearch text
findFind files
dfCheck disk space
duCheck directory size
freeCheck RAM
topMonitor processes
chmodChange permissions
chownChange ownership
tarArchive/extract files
curlTest URLs/API requests
wgetDownload files
pingTest network connectivity
ssView network sockets
digCheck DNS
systemctlManage services
journalctlView system logs
sshConnect to remote server
sudoRun administrative commands

Final Thoughts

Linux commands provide direct control over a server and are an essential skill for VPS administrators, developers, system administrators, and web hosting professionals. You do not need to memorize every command. Instead, learn the commands you frequently use for file management, permissions, networking, resource monitoring, services, and troubleshooting.

Before running a potentially destructive command on a production server, verify exactly what it will do and maintain reliable backups. A few seconds of checking can prevent hours of recovery work.

ByVandeeta
Updated August 12, 2026
  • Miscellaneous

Read Next

What to Do When Your Website Goes Down
ByVandeeta
August 12, 2026

What to Do When Your Website Goes Down: A Complete Troubleshooting Guide

What to Do When Your Website Goes Down: A Complete Troubleshooting Guide A website going down can be…
  • Miscellaneous
How to Migrate a Website Without Downtime
ByVandeeta
August 12, 2026

How to Migrate a Website Without Downtime: A Complete Guide

How to Migrate a Website Without Downtime: A Complete Guide Moving a website from one hosting provider, server,…
  • Miscellaneous
Why Your Website Is Slow and How to Fix It
ByVandeeta
August 12, 2026

Why Your Website Is Slow and How to Fix It?

Why Your Website Is Slow and How to Fix It Website speed has become an essential part of…
  • Miscellaneous

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Explore Categories

  • Control Panels 7
  • Magento 52
  • Miscellaneous 5
  • SEO 17
  • Technology 10
  • Trends 9
  • Web Hosting 7
  • Wordpress 100

Recent Posts

  • How to Fix WordPress “Too Many Redirects”
  • How to Fix WordPress Critical Error
  • How to Fix WordPress Database Connection Error
  • How to Fix WordPress White Screen of Death
  • How to Fix WordPress 404 Error

Recent Comments

  1. Tabias H. on The Future is 5G: Understanding the Next Wave of Connectivity
  2. Elliot Alderson on Evolving Workspaces: The Rise of the Hybrid Work Trend
  3. James Mann on Evolving Workspaces: The Rise of the Hybrid Work Trend
Swyft

Welcome to the Ehostpiya Blog, your trusted resource for web hosting, WordPress, VPS, domains, website security, and online business tips.

Our goal is to make web hosting and website management easier to understand for everyone—from beginners launching their first website to experienced developers and business owners. We publish practical guides, hosting tips, tutorials, and helpful insights to help you build, manage, and grow your website successfully.

At Ehostpiya, we believe that reliable information and quality hosting go hand in hand. Explore our latest articles and discover simple solutions for a faster, safer, and more successful online presence.

  • Facebook
  • Twitter
  • Instagram
  • Pinteres

Featured Posts

  • AI and Ethics: Navigating the Complex Landscape of Artificial Intelligence
    by Vandeeta
    October 11, 2023
  • AR and VR: Blurring the Lines Between Reality and Virtuality
    by Vandeeta
    October 11, 2023
  • Best WordPress Caching Plugins to Improve Website Speed
    by Vandeeta
    September 26, 2026
  • Blockchain Unchained: How Distributed Ledger Technology is Transforming Industries
    by Vandeeta
    October 11, 2023

Web Hosting Discount

cLAIM NOW
logo

Ehostpiya is reliable Web hosting provider, with aim to provide affordable Website and application hosting to various clients for their online business and presence.

Hosting
  • Web Hosting
  • Cloud VPS
  • Reseller Hosting
  • Email Hosting
  • Dedicated Server
  • Nodejs Hosting
  • SSL Certificate
Legal
  • Accepted Uses Policy
  • privacy Policy
  • Terms of Service
  • Refund and cancellation
  • Service Delivery Policy
Company
  • About Us
  • Our Clients
  • Contact Us
  • Our Blog
Support & Tools
  • Open Support Request
  • View Ticket
  • Knowledge Base
  • Report Abuse
  • check nameserver
  • What is my IP
  • Mx lookup

© Ehostpiya, All rights reserved

  • Terms & Condition
  • Privacy Policy