Episode 1.4
MASTERING LINUX SHELL
Class 12 (10+2) • Unit 1: Network Operating System
💡 Direct Stream: You can also watch directly on YouTube or via local server:
📺 Watch on YouTube.com
Episode code: 1.4
✍️ Episode 1.4 Topic Notes
📌 Essential System Directories:
/(Root): The top-level foundational parent directory of the entire filesystem./bin(User Binaries): Essential command binaries executable by all normal users (ls,cp,mv,rm,cat,date)./sbin(System Binaries): Critical administrative utilities intended exclusively for the root administrator (fdisk,reboot,iptables,ifconfig)./etc(Configuration): Host-specific plain-text configuration files and startup scripts (/etc/passwd,/etc/shadow,/etc/network/interfaces).
📌 A. Navigation & Inspection
pwd(Print Working Directory): Outputs the full absolute path of the current directory.ls(List Directory Contents):ls -l: Detailed long listing format (permissions, ownership, size, timestamp).ls -a: Shows all files including hidden dotfiles (.bashrc,.profile).
📌 B. File & Directory Management
touch filename: Creates an empty file or updates the access/modification timestamps of an existing file.mkdir dirname: Creates a new directory. (mkdir -p a/b/ccreates nested parent directories).rmdir dirname: Removes an empty directory.cp source dest: Copies files. (cp -r dir1 dir2recursively copies entire directory trees).
📌 C. Viewing and Paging File Content
cat file: Concatenates and prints the entire file content directly to standard output.more file&less file: Interactive terminal pagers allowing page-by-page and line-by-line scrolling through large text files.head file: Displays the first 10 lines of a file (customizable viahead -n 25 file).tail file: Displays the last 10 lines of a file (tail -f fileactively follows live log updates).
📌 Permission Types & Octal Numerical Values:
r(Read): Value = 4 (Allows viewing file contents or listing directory contents).w(Write): Value = 2 (Allows modifying file contents or creating/deleting files in a directory).x(Execute): Value = 1 (Allows running a program/script or traversing into a directory viacd).
📌 Modifying Permissions:
- Octal Mode:
chmod 755 script.sh(Owner: rwx [7], Group: r-x [5], Others: r-x [5]). - Symbolic Mode:
chmod u+x filename(Add execute to user),chmod go-w filename(Revoke write from group and others). - Changing Ownership:
chown student:students filename(Changes owner and group).