Fundamentals 30 min read

All the Linux Basics You Need in One Guide

This article provides a concise Linux fundamentals guide covering the OS overview, essential keyboard shortcuts, common file‑management commands, disk navigation, network utilities, and basic system‑administration commands, each illustrated with syntax and practical examples.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
All the Linux Basics You Need in One Guide

Linux Overview

GNU/Linux is a free, open‑source, Unix‑like operating system whose kernel was first released by Linus Torvalds on 5 October 1991. It follows POSIX, supports multi‑user, multitasking, multithreading and multi‑CPU environments, and runs on both 32‑bit and 64‑bit hardware. Hundreds of distributions exist; common community‑driven ones include Debian and Arch Linux, while commercial variants include Red Hat Enterprise Linux, SUSE and Oracle Linux. Well‑known distributions are Ubuntu, Red Hat, CentOS, Debian, Fedora, openSUSE and SUSE.

Common Keyboard Shortcuts

Tab – auto‑completes commands, file names, directory names or option prefixes.

Ctrl +C – immediately interrupts the current command or process.

Ctrl + Z – sends the running job to the background.

Ctrl +D – signals end‑of‑file (EOF) to the shell.

Ctrl +A – moves the cursor to the beginning of the line.

Ctrl + E – moves the cursor to the end of the line.

Ctrl + U – erases from the cursor position to the beginning of the line.

Ctrl + K – erases from the cursor position to the end of the line.

Ctrl + W – deletes the word preceding the cursor.

Ctrl + Y – pastes text previously cut with Ctrl + U, Ctrl + K or Ctrl + W.

Ctrl + P – shows the previous command in history; repeated presses step further back.

Ctrl + N – shows the next command in history; works together with Ctrl + P.

Ctrl + R – searches command history interactively.

Ctrl + ←/→ – moves the cursor word‑wise.

Alt + d – deletes the word to the right of the cursor.

Common Linux Commands

File Management

cat – concatenate and display file contents. cat [-nbs] [--help] [--version] fileName -n, --number – number all output lines starting at 1.

-b, --number-nonblank – number non‑blank lines only.

-s, --squeeze-blank – replace multiple consecutive blank lines with a single blank line.

Examples:

cat -n textfile1 > textfile2
cat -b textfile1 textfile2 >> textfile3
cat /dev/null > /etc/test.txt

more – page‑wise file viewer with navigation and search.

more [-dlfpcsu] [-num] [+/pattern] [+linenum] [fileNames…]

-num – number of lines per page.

-d – display a prompt when waiting for input.

-l – ignore ^L (form‑feed) pauses.

-f – count actual lines, not wrapped lines.

-p – clear the screen before each page.

-c – display then clear.

-s – squeeze multiple blank lines.

-u – suppress underlining.

+/pattern – search for a pattern before displaying each file.

+num – start display at line number num .

Examples:

more -s testfile
more +20 testfile

rm – remove files or directories. rm [options] name… -i – interactive confirmation before each removal.

-f – force removal, ignoring write‑protect flags.

-r – recursive removal of directories.

Examples:

rm test.txt
rm -r homework
rm -r *

cp – copy files or directories.

cp [options] source dest
cp [options] source… directory

-a – archive; preserve attributes, links and copy recursively.

-d – preserve links.

-f – force overwrite without prompting.

-i – interactive overwrite confirmation.

-p – preserve timestamps and permissions.

-r – copy directories recursively.

-l – create hard links instead of copying.

Example: cp -r test/ newtest read – read a line of input from standard input.

read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name …]

-a – assign input to an array variable.

-d – specify a delimiter character.

-p – display a prompt before reading.

-e – enable readline editing.

-n – read at most nchars characters.

-r – raw mode; backslash is not treated as escape.

-s – silent mode; input is not echoed.

-t – timeout in seconds.

-u – read from file descriptor fd .

Disk Management

cd – change the current working directory. cd [dirName] Examples:

cd /usr/bin
cd ~
cd ../..

mkdir – create a new directory. mkdir [-p] dirName -p – create parent directories as needed.

Examples:

mkdir runoob
mkdir -p runoob2/test

pwd – print the current working directory. pwd [--help] [--version] Example: pwd rmdir – remove empty directories. rmdir [-p] dirName -p – remove parent directories if they become empty.

Examples:

rmdir AAA
rmdir -p BBB/Test

ls – list directory contents. ls [-alrtAFR] [name…] -a – include hidden files.

-l – long format (permissions, owner, size, etc.).

-r – reverse order.

-t – sort by modification time.

-A – all except "." and "..".

-F – append indicator (*/ for executables, / for directories).

-R – recursive listing.

Examples:

ls /
ls -ltr s*
ls -lR /bin
ls -AF

Network Communication

telnet – remote login client.

telnet [-8acdEfFKLrx] [-b<alias>] [-e<char>] [-k<realm>] [-l<user>] [-n<logfile>] [-S<type>] [-X<auth>] host [port]

-8 – allow 8‑bit data.

-a – attempt automatic login.

-b – specify host alias.

-c – ignore .telnetrc.

-d – enable debug mode.

-e – set escape character.

-F – upload Kerberos V5 authentication data.

-k – specify Kerberos realm.

-l – specify remote username.

-L – allow 8‑bit output.

-r – use rlogin‑style UI.

-S – set IP Type‑of‑Service.

-x – enable encryption if supported.

-X – disable specific authentication method.

Example: telnet 192.168.1.2 ping – test reachability of a host using ICMP.

ping [-dfnqrRv] [-c<count>] [-i<interval>] [-I<iface>] [-l<preload>] [-p<pattern>] [-s<size>] [-t<ttl>] host

-c – number of packets to send.

-i – interval between packets.

-I – specify network interface.

-l – preload packets.

-p – fill packet with pattern.

-s – packet size.

-t – TTL value.

-v – verbose output.

-q – quiet output.

-r – ignore routing table.

-R – record route.

-d – enable SO_DEBUG.

Example: ping www.w3cschool.cc ifconfig – display or configure network interfaces. ifconfig [interface] [options] add<addr> – add IPv6 address.

del<addr> – delete IPv6 address.

down – deactivate interface.

up – activate interface.

mtu – set MTU.

netmask – set subnet mask.

broadcast – set broadcast address.

... (other standard ifconfig options)

Example (display):

ifconfig

System Management

exit – exit the current shell or script. exit [status] Status 0 indicates success; non‑zero indicates failure.

kill – send signals to processes.

kill [-s signal] pid
kill -l          # list signal names

Typical signals: SIGTERM (15) for graceful termination, SIGKILL (9) for forced termination.

ps – report a snapshot of current processes. ps [options] [--help] -A – list all processes.

-w – wide output.

-au – detailed output.

-aux – include processes of all users.

Example (find php processes): ps -ef | grep php sudo – execute a command as another user (default root).

sudo -V   # version
sudo -h   # help
sudo -l   # list privileges
sudo -v   # validate timestamp
sudo -k   # reset timestamp
sudo -b   # run command in background
sudo -p prompt   # custom password prompt
sudo -u user   # run as specified user
sudo command

su – switch to another user account.

su [-fmp] [-c command] [-s shell] [--help] [--version] [-] [USER [ARG]]

-f – fast mode (skip startup files).

-m, -p – preserve environment.

-c – run a command as USER then return.

-s – specify shell.

-l – login shell (reset environment, change working directory).

Examples:

su -c ls root
su root -f
su - clsung

free – display memory usage. free [-bkmotV] [-s interval] -b – display in bytes.

-k – display in kilobytes.

-m – display in megabytes.

-h – human‑readable units.

-t – show totals.

-s – repeat every interval seconds.

Example: free -h clear – clear the terminal screen.

clear
shortcutsFile Managementnetwork-toolscommand-linesystem-administration
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

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.