Mastering Unix/Linux: From OS Basics to Essential Commands and Remote Operations
This comprehensive guide covers Unix/Linux operating system fundamentals, file system structures, common commands, user and permission management, editor usage, remote access via SSH, file transfer, and building a simple C‑based web server, providing practical examples and step‑by‑step instructions for developers and system administrators.
1. Unix/Linux Operating System Overview
The operating system acts as a bridge between hardware and applications, making computers easier to use, more efficient, and extensible for development and testing.
Unix originated at Bell Labs in 1969, later rewritten in C in 1973, leading to multiple variants such as BSD and AT&T Unix. Linux began in 1991 when Linus Torvalds created a Minix‑derived kernel, evolving with contributions from the GNU project, POSIX standards, and the Internet.
Linux Users and Variants
Minix – a teaching OS with limited practical use.
Linux – built on Unix, Minix, GNU tools, POSIX, and the Internet.
GNU project provides essential tools (gcc, gdb, bash, etc.).
POSIX defines a common API for Unix‑like systems.
Linux Kernel and Distributions
The kernel is the core component managing hardware and processes. Stable kernels are production‑ready; development kernels evolve rapidly. Source code is hosted at http://www.kernel.org. Distributions bundle the kernel with GNU libraries, X Window system, and desktop environments.
2. File System Basics
Directories and Paths
Directories group related files and can contain sub‑directories. Paths locate files: absolute paths start with /, while relative paths are based on the current directory.
Linux Directory Structure
/– root directory. /bin, /usr/bin – executable binaries. /boot – kernel and bootloader files. /dev – device files. /etc – system configuration. /home – user home directories. /lib, /usr/lib – shared libraries. /proc – virtual filesystem exposing kernel info. /tmp – temporary files. /var – variable data such as logs.
Everything Is a File
Linux treats regular files, directories, device files, pipes, and links uniformly as files, simplifying I/O handling.
3. Common Commands
Command Syntax
command [-options] [parameter1] …Help and Manual Pages
--help– brief usage. man – full manual with sections (e.g., 1 for standard commands).
File Management Commands
ls– list directory contents (options: -a, -l, etc.). cat – display file content. cp, mv, rm, mkdir, rmdir – copy, move, delete, create, and remove directories. chmod – change permissions (symbolic or numeric). chown, chgrp – change owner or group. find – locate files by criteria. tar, gzip, bzip2, zip / unzip – archive and compress files.
Process Management
ps– snapshot of processes. top – dynamic process monitor. kill – terminate processes (e.g., kill -9 PID). &, jobs, fg – background job control.
Network Utilities
ifconfig– view/configure network interfaces. ping – test connectivity. route – manage routing tables. netstat – display network connections.
4. Text Editors
gedit
A simple graphical editor suitable for basic editing.
vi / vim
Powerful modal editors available on all Linux distributions. Basic operations include opening files ( vi filename), entering insert mode ( i), saving and exiting ( :wq), searching ( /pattern), and replacing ( :%s/old/new/g).
5. Remote Operations
SSH
Secure Shell provides encrypted remote login and command execution. Use ssh -l username host_ip to connect. First connection prompts to trust the host.
File Transfer with scp
Copy files securely between hosts:
Local to remote: scp file user@host:/path/ Remote to local: scp user@host:/path/file ./ Recursive directory copy: add -r.
Windows to Linux via Xmanager
Xshell (SSH/TELNET client) and Xftp (SFTP/FTP client) enable Windows users to manage Linux servers. Set appropriate character encoding (UTF‑8) to avoid garbled text.
6. Building a Simple C‑Based Web Server
Download http.tar.gz, extract, and compile with make. Run as root to start the service. Test by accessing http://<em>server_ip</em>/hello.cgi after creating a CGI program (e.g., a simple hello.c that prints HTML). Ensure the CGI binary has execute permission and is placed in the server’s CGI directory.
To fix Chinese character garbling, set the browser to UTF‑8 or embed a meta tag:
<meta http-equiv="content-type" content="text/html;charset=utf-8">7. Summary
This tutorial equips readers with a solid foundation in Unix/Linux concepts, file system navigation, essential command‑line tools, user and permission management, editor proficiency, secure remote access, file transfer techniques, and hands‑on experience building and testing a minimal web server, making it a valuable resource for developers, system administrators, and anyone seeking practical Linux expertise.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
