Fundamentals 27 min read

Essential Linux Basics: All You Need in One Guide

This comprehensive guide introduces Linux fundamentals, covering its history and major distributions, essential keyboard shortcuts, core file and disk management commands, network utilities, and system administration tools, each illustrated with clear syntax and practical examples.

IoT Full-Stack Technology
IoT Full-Stack Technology
IoT Full-Stack Technology
Essential Linux Basics: All You Need in One Guide

Linux Overview

Linux, officially 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 standards, supports multi‑user, multitasking, multithreading and multi‑CPU environments, and runs on both 32‑bit and 64‑bit hardware. Popular distributions include Ubuntu, Red Hat, CentOS, Debian, Fedora, SUSE and openSUSE.

Common Keyboard Shortcuts

[Tab] Auto‑completes commands, filenames, directories or options.

[Ctrl+C] Interrupts the current command or process.

[Ctrl+Z] Sends the running job to the background.

[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 to the start of the line.

[Ctrl+K] Erases from the cursor to the end of the line.

[Ctrl+W] Deletes the word before the cursor.

[Ctrl+Y] Pastes text previously deleted with Ctrl+U, Ctrl+K or Ctrl+W.

[Ctrl+P] Shows the previous command in history.

[Ctrl+N] Shows the next command in history.

[Ctrl+R] Searches command history.

[Ctrl+←/→] Moves the cursor word by word.

[Alt‑d] Deletes the word to the right of the cursor.

File Management Commands

cat concatenates and displays file contents. cat -n textfile1 > textfile2 Options:

-n / --number: number all output lines.

-b / --number-nonblank: number non‑blank lines only.

-s / --squeeze-blank: collapse multiple blank lines into one.

more displays file content page by page. more -s testfile Key options include:

-num: lines per page.

-d: prompt.

-l: disable ^L pause.

-f: count actual lines.

-p: clear screen before each page.

-c: display then clear.

-s: squeeze blanks.

-u: suppress underlining.

+/pattern: search.

+num: start at line.

rm removes files or directories.

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

Options:

-i: prompt before each removal.

-f: force removal without prompts.

-r: remove directories recursively.

cp copies files or directories. cp -r test/ newtest/ Options include:

-a: archive (preserve links, attributes, copy recursively).

-d: preserve links.

-f: force overwrite.

-i: interactive overwrite.

-p: preserve timestamps and permissions.

-r: recursive copy.

-l: create hard links instead of copying.

read reads a line of input from standard input. read -p "Enter name: " name Options include:

-a: read into an array.

-d: specify delimiter.

-p: prompt message.

-e: enable line editing.

-n: maximum characters to read.

-r: disable backslash escaping.

-s: silent mode (no echo).

-t: timeout in seconds.

-u: read from file descriptor.

Disk Management Commands

cd changes the current directory.

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

mkdir creates directories.

mkdir runoob
mkdir -p runoob2/test

Option -p creates parent directories as needed.

pwd prints the current working directory. pwd rmdir removes empty directories.

rmdir AAA
rmdir -p BBB/Test

Option -p also removes parent directories when they become empty.

Network Communication Commands

telnet logs into a remote host. telnet 192.168.1.2 Common options:

-8: allow 8‑bit data.

-a: attempt automatic login.

-b<alias>: specify host alias.

-c: ignore .telnetrc.

-d: debug mode.

-e<char>: set escape character.

-l<user>: specify login name.

-r: rlogin‑style UI.

-S<TOS>: set Type‑of‑Service.

-x: enable encryption if supported.

-X: disable specified authentication.

ping checks host reachability using ICMP. ping www.w3cschool.cc Key options:

-c<count>: number of echo requests.

-i<interval>: interval between packets.

-I<iface>: specify network interface.

-l<preload>: send packets before waiting for replies.

-n: numeric output only.

-q: quiet output.

-r: ignore routing table.

-R: record route.

-s<size>: packet size.

-t<TTL>: time‑to‑live.

-v: verbose.

ifconfig displays or configures network interfaces. ifconfig Parameters include:

add<addr> / del<addr>: add or delete IPv6 address.

down / up: disable or enable interface.

hw<type><addr>: set hardware address.

io_addr<addr>: set I/O address.

irq<num>: set IRQ.

media<type>: set media type.

mem_start<addr>: set memory start.

metric<num>: routing metric.

mtu<bytes>: set MTU.

netmask<mask>: set netmask.

tunnel<addr>: set tunnel address.

-broadcast<addr>: treat as broadcast.

-pointopoint<addr>: point‑to‑point link.

-promisc: enable/disable promiscuous mode.

IP address: assign IPv4 address.

System Management Commands

exit exits the current shell with an optional status code. exit kill sends signals to processes (default SIGTERM, force with SIGKILL).

kill 12345
kill -KILL 123456

Options:

-l: list signal names.

-s <signal>: specify signal.

ps reports process status. ps -ef | grep php Common options:

-A: all processes.

-w: wide output.

-au: detailed user‑oriented view.

-aux: all users.

sudo runs commands with superuser privileges. sudo ls Key options:

-V: version.

-h: help.

-l: list privileges.

-v: re‑authenticate.

-k: force password next time.

-b: run in background.

-p <prompt>: custom password prompt.

-u <user>: run as specified user.

-s: run a shell.

-H: set HOME to target user’s home directory.

su switches to another user account.

su -c ls root
su - clsung

Options:

-f / --fast: skip startup files.

-m / -p / --preserve-environment: keep environment.

-c <command> / --command=<command>: run command as target user.

-s <shell> / --shell=<shell>: specify shell.

-l / --login: simulate full login (reset environment, change directory).

free displays memory usage. free -h Options:

-b: bytes.

-k: kilobytes.

-m: megabytes.

-h: human‑readable.

-t: show totals.

-s <seconds>: repeat at interval.

clear clears the terminal screen.

clear
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.

Linuxshellcommand lineNetworkingsystem administrationbasics
IoT Full-Stack Technology
Written by

IoT Full-Stack Technology

Dedicated to sharing IoT cloud services, embedded systems, and mobile client technology, with no spam ads.

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.