Linux Concepts Taught in Python-100-Days: Shell Commands, Permissions, and System Administration
The Python-100-Days repository dedicates Days 34–35 to comprehensive Linux fundamentals, covering shell commands, file permissions, process management, and system administration in the file Day31-35/34-35.玩转Linux操作系统.md.
The jackfrued/Python-100-Days curriculum recognizes that Python developers need strong Unix-like environment skills. The Linux chapter provides practical system administration knowledge that directly supports Python scripting, deployment automation, and containerization workflows.
Essential Shell Commands and Scripting Basics
The chapter introduces the Bash shell (Bourne-Again SHell) as the primary command-line interface, teaching fundamental syntax and operators used throughout the course.
Core Command Categories
According to the source material in Day31-35/34-35.玩转Linux操作系统.md (lines 84–133), the following command groups are covered:
- System inspection:
w,who,last,ps,top,free,df,du - File operations:
cat,tac,head,tail,more,less,touch,rm,cp,mv,ln,find - Text processing:
grep,awk,sed - Compression and transfer:
tar,gzip,gunzip,wget,curl - Directory management:
mkdir,rmdir
Redirection and Pipelines
The material explains pipelines (|) and redirection operators (>, >>, 2>) essential for Python developers working with subprocesses. These concepts appear in Day31-35/34-35.玩转Linux操作系统.md (lines 86–92) as foundational scripting patterns.
File System Hierarchy and Permissions
Understanding the Linux directory structure is critical for Python projects that interact with configuration files, logs, or virtual environments.
Standard Directory Structure
The chapter maps the Filesystem Hierarchy Standard (lines 40–61), explaining:
/binand/usr/binfor essential binaries/etcfor configuration files/varfor variable data and logs/homefor user directories/rootfor the superuser's home
Permission Management
File security concepts in Day31-35/34-35.玩转Linux操作系统.md (lines 64–82) include:
- Numeric and symbolic modes: Using
chmod 755versuschmod u+x - Ownership commands:
chown,chgrp, andumaskfor default permissions - Execution rights: How permissions affect Python script execution
User Management and Process Control
The curriculum teaches multi-user system administration, preparing Python developers for server environments and deployment scenarios.
User and Group Administration
As documented in lines 117–137, the following commands are taught:
- Account creation:
useradd,userdel,groupadd - Authentication:
passwd,su(switch user) - Privilege escalation:
sudo,visudofor secure command execution
Process Management
Process control concepts (lines 108–119) include:
- Viewing processes:
psfor snapshots,topfor real-time monitoring - Signal handling:
kill,pkillfor terminating processes - Job control: Background execution (
&),jobs,bg, andfg - System calls: The
forksystem call and its Linux-specific implementation
System Administration and Automation
The chapter extends into production-ready skills for maintaining Python applications on Linux servers.
Service and Package Management
- Daemon control: Managing services with
systemctland the traditionalservicecommand, including the naming convention ofdsuffixes for background services (lines 122–132) - Package operations: Using
yumandrpmto search, install, remove, and query software packages, with emphasis on repository dependencies (lines 56–66)
Scheduling and Networking
- Task automation: One-time scheduling with
at,atq, andatrm; recurring jobs withcron(lines 84–92) - Network utilities: Connectivity testing with
ping, interface configuration viaifconfig/ip, connection monitoring withnetstatandss, and remote operations usingsshandscp - Log inspection: System monitoring through
journalctland resource tracking withiotop
Practical Examples from the Source Code
The repository includes runnable shell examples that demonstrate these Linux concepts in action.
Listing Python Processes
# Show all Python processes with their PID and command line
ps -ef | grep '[p]ython'
This example combines ps with grep filtering, demonstrating process inspection techniques mentioned in the shell commands section.
Managing Directory Permissions
# Create a directory for temporary data
mkdir -p /tmp/mydata
# Give read/write permission to the group, read-only to others
chmod 750 /tmp/mydata
# Show the resulting permissions
ls -ld /tmp/mydata
This sequence illustrates mkdir, numeric chmod modes, and filesystem inspection.
Creating Executable Backup Scripts
#!/usr/bin/env bash
# backup.sh – copy a file to a timestamped backup directory
SRC=$1
DST=/var/backups/$(date +%Y%m%d_%H%M%S)
mkdir -p "$DST"
cp "$SRC" "$DST/"
echo "Backup of $SRC saved to $DST"
Execute with:
chmod +x backup.sh && ./backup.sh /etc/passwd
This demonstrates Bash shebang syntax, variable assignment, the date command, and script execution permissions.
Installing System Packages
sudo yum install -y htop
Shows yum package installation with sudo privilege escalation, reflecting the CentOS-based environment used in the course.
Scheduling Future Tasks
# Run a cleanup script tomorrow at 02:30 AM
echo "/usr/local/bin/cleanup.sh" | at 02:30 tomorrow
Illustrates the at command for one-time job scheduling via piped input.
Source File Locations
All Linux concepts are contained in the following repository paths:
Day31-35/34-35.玩转Linux操作系统.md: The core chapter covering all listed concepts, from basic commands to system monitoring (lines 40–137)Day31-35/res/: Directory containing illustrative figures including file-mode tables and directory hierarchy diagrams referenced in the textREADME.md: Entry point in the repository root that indexes the Linux chapter under the "玩转Linux操作系统" section
Summary
The Python-100-Days repository teaches practical Linux administration through:
- Shell fundamentals: Bash syntax, pipelines, and redirection operators for command composition
- Filesystem mastery: Directory hierarchy, permission models using
chmodandchown, and navigation commands - System oversight: Process control with
psandtop, user management viauseraddandsudo, and service administration throughsystemctl - Operational automation: Package management with
yum, task scheduling usingatandcron, and network utilities includingsshandscp
These concepts appear in Day31-35/34-35.玩转Linux操作系统.md and provide the Unix environment foundation necessary for professional Python development and deployment.
Frequently Asked Questions
Is the Linux content in Python-100-Days suitable for complete beginners?
Yes, the chapter assumes no prior Linux experience. It begins with operating system history and basic shell navigation before advancing to process management and permissions. The progression from ls and cd to systemctl and cron follows a pedagogical structure designed for Python learners new to Unix-like systems.
Does the material cover only CentOS/RHEL systems?
The primary examples use CentOS conventions, specifically yum and rpm for package management. However, the core concepts—Bash scripting, file permissions, process signals, and the Filesystem Hierarchy Standard—apply universally across Debian, Ubuntu, and other Linux distributions, with only the package manager syntax varying between yum and apt.
How do these Linux concepts support Python programming specifically?
The curriculum emphasizes skills that Python developers use daily: writing deployment scripts with Bash, managing virtual environments in /home or /usr/local, inspecting running Python processes with ps, setting executable permissions on .py files with chmod, and automating Python task scheduling with cron. The fork system call discussion also connects to Python's multiprocessing module internals.
Where can I find the actual Linux commands and exercises?
All commands, diagrams, and exercises reside in Day31-35/34-35.玩转Linux操作系统.md within the jackfrued/Python-100-Days repository. This single Markdown file contains the complete 34th and 35th day curriculum, including the command tables, permission explanations, and runnable shell examples referenced throughout the course.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →