Fundamentals 8 min read

Master Essential Linux Commands: wget, scp, ssh-keygen, chmod, tar

This tutorial introduces six indispensable Linux command‑line tools—wget, scp, ssh‑keygen, chmod, tar, and alias—explaining their purpose, common options, and practical examples such as downloading files, transferring data securely, managing permissions, creating archives, and simplifying repetitive commands.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Essential Linux Commands: wget, scp, ssh-keygen, chmod, tar

The article assumes readers have basic command‑line experience and presents six useful Linux commands with practical tips, aiming to deepen command‑line proficiency.

wget

The wget utility downloads files over HTTP, HTTPS, or FTP and is included in most Linux distributions. The simplest usage is to provide the URL of the target file.

wget http://website.com/static/images/header.jpg
wget

runs non‑interactively, allowing it to continue downloading after the user logs out.

scp

scp

(secure copy) transfers files between a local machine and a remote host over SSH. It works like cp but with a remote source or destination.

Download a file from a remote server:

scp [email protected]:/path/to/foobar.txt /some/local/directory

Upload a file to a remote server:

scp /some/local/directory/foobar.txt [email protected]:/destination/path/

Use the -r option to copy directories recursively.

ssh-keygen

The ssh-keygen command creates a new SSH key pair, which can be added to services like GitLab or Bitbucket to enable password‑less authentication. ssh-keygen -t ed25519 The example uses the modern Ed25519 algorithm; users should research other available algorithms as needed.

chmod

chmod

changes file system object permissions on Unix‑like systems. Correct permission settings are crucial for security and functionality.

Example granting read/write to the owner and group for robots.txt: chmod 664 robots.txt Example granting read, write, and execute to the owner and group for a directory public/images while giving others read and execute access:

chmod 775 public/images

tar

The tar command creates and extracts archive files. It is the most common tool for bundling multiple files into a single archive.

Create an archive of a directory: tar -cvf my-archive.tar /path/to/directory Extract the archive to a specific location:

tar -xvf my-archive.tar -C /home/myfolder/

alias

Aliases let you define short shortcuts for long commands. A temporary alias works only for the current shell session.

alias short-command="your custom and very long command here"

To make an alias persistent, add it to the user’s shell configuration file (e.g., ~/.bashrc or ~/.zshrc).

Output Redirection & Command Chaining

Redirect command output to a file using >: ls -al > myfile Run multiple commands sequentially with a semicolon ( ;), regardless of success: ls -al; pwd; Execute the second command only if the first succeeds using &&: mkdir images && cd images Execute the second command only if the first fails using || (example omitted for brevity).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

command-linechmodscpwgettarssh-keygen
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.