Projects

Terminal Basics Every Website Owner Should Know

Terminal Basics – Terminal Basics Every Website Owner Should Know

In this guide: Linux terminal basics for website owners: connecting with SSH, navigation commands, file commands, permissions, WP-CLI, and safe practices.

You don’t need to be a developer to benefit from the command line. Many hosting tasks — moving files, fixing permissions, running WordPress updates, or checking logs — are faster in the terminal than in a web interface. Here are the essential commands every website owner should know.

Why use the terminal

  • Speed: move, copy, or search thousands of files in seconds.
  • Power: tasks that web panels can’t do, like bulk search-and-replace or scripted backups.
  • Troubleshooting: read error logs and check disk usage directly.
  • WP-CLI: manage WordPress from the command line — update plugins, create users, clear caches.
  • VPS management: on a VPS, the terminal is often the main interface.

Connecting with SSH

SSH (Secure Shell) lets you securely connect to your server’s terminal.

  1. Enable SSH access in your hosting panel (some shared hosts require you to turn it on).
  2. Find your SSH host, username, and port (the default port is 22; some hosts use another).
  3. Connect from your computer:
    – Mac/Linux: open Terminal.
    – Windows: use Windows Terminal/PowerShell (includes OpenSSH) or a client like PuTTY.
ssh username@your-server.com -p 22

For better security, use SSH keys instead of passwords — see SSH Keys vs Passwords.

Navigation commands

pwd                 # print working directory (where am I?)
ls                  # list files
ls -la              # list all files, including hidden, with details
cd public_html      # change directory
cd ..               # go up one level
cd ~                # go to your home directory

Tips:

  • Press Tab to autocomplete file and folder names.
  • Press the Up arrow to repeat previous commands.
  • Use clear to clean the screen.

File commands

cat file.txt              # show file contents
less error_log            # scroll through a long file (q to quit)
tail -n 50 error_log      # show the last 50 lines (great for logs)
tail -f error_log         # follow a log live as errors appear
nano wp-config.php        # edit a file in a simple editor
cp file.txt backup.txt    # copy a file
cp -r folder/ backup/     # copy a folder
mv old.txt new.txt        # move or rename
mkdir new-folder          # create a directory
rm file.txt               # delete a file (permanent!)
rm -r folder/             # delete a folder (careful!)

Searching:

grep -r "search text" .         # find text in files
find . -name "*.php" -mtime -2  # PHP files changed in the last 2 days (useful after a hack)
du -sh *                        # size of each folder (find what uses disk space)
df -h                           # disk usage summary

Archives:

zip -r site-backup.zip public_html/
unzip archive.zip
tar -czf backup.tar.gz public_html/
tar -xzf backup.tar.gz

Permissions (common WordPress defaults):

find . -type d -exec chmod 755 {} \;   # folders
find . -type f -exec chmod 644 {} \;   # files
chmod 600 wp-config.php                 # stricter for config (check your host's recommendation)

WP-CLI (if installed — many hosts include it):

wp core version
wp plugin list
wp plugin update --all
wp cache flush
wp search-replace 'http://old.com' 'https://new.com' --dry-run
wp user create editor1 editor@example.com --role=editor

Always run search-replace with --dry-run first, and back up the database before the real run.

Safe practices

  • Back up before changing anything. A quick cp or zip of important files is cheap insurance.
  • Double-check rm commands. There’s no recycle bin. Never run rm -rf with variables or wildcards you haven’t verified.
  • Know where you are — run pwd before destructive commands.
  • Avoid running as root unless necessary; on VPS, use a normal user with sudo.
  • Never use chmod 777 — it makes files writable by everyone and creates security risks.
  • Test on staging when running bulk operations.
  • Log out when finished: exit.

Start small: connect via SSH, navigate to your site folder, and read your error log. That alone will make you a better troubleshooter.

Further reading: MDN Web Docs learning area

Key Takeaways: Terminal Basics

  • SSH gives you secure access to your server’s terminal.
  • Learn pwd, ls, cd, cp, mv, rm, tail, and grep.
  • WP-CLI makes WordPress management fast.
  • Back up first, verify destructive commands, and never use 777 permissions.
Z
zasma171

Writes for Hostreta about the topics covered in this article.

Comments (0)

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

Recent Comments

No comments to show.
Ad · AdSense
Ad space 300×250
Affiliate links
Tools we recommend
Protect Your Website with Automated Daily Backups
$2.09
Get it
the easiest way to manage all of your social media accounts
$29
Get it
Starter Website Get online, properly
$249
Get it
google workspace Business Starter
$3.75
Get it
Nord Vpn Cybersecurity. Built for Everyday Use
$8.99
Get it

We may earn a commission on purchases made through these links, at no extra cost to you.

Ad · AdSense
Ad space 300×600
Ad · AdSense
Ad space 300×600

$ top hosting picks

affiliate
★★★★★

NovaHost

$2.95/mo,renews at $9.95
  • Free SSL + domain, first year
  • 1-click WordPress install
  • 24/7 chat, sub-5-min response
get this deal →
affiliate link · we may earn a commission
★★★★★

CloudRoot

$4.50/mo,renews at $12.95
  • Built-in CDN + caching
  • Daily backups, 30-day retention
  • Staging environments included
get this deal →
affiliate link · we may earn a commission
★★★★★

ByteForge

$3.75/mo,renews at $10.95
  • NVMe storage on every plan
  • Unlimited bandwidth
  • Free migration from your old host
get this deal →
affiliate link · we may earn a commission

Never miss a new article

Join thousands of developers and builders getting a weekly digest of the best tech articles.