# Linux Concepts Taught in Python-100-Days: Shell Commands, Permissions, and System Administration

> Learn essential Linux concepts like shell commands, permissions, and system administration through the Python-100-Days course. Master Linux fundamentals efficiently.

- Repository: [骆昊/Python-100-Days](https://github.com/jackfrued/Python-100-Days)
- Tags: tutorial
- Published: 2026-02-24

---

**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:
- `/bin` and `/usr/bin` for essential binaries
- `/etc` for configuration files
- `/var` for variable data and logs
- `/home` for user directories
- `/root` for 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 755` versus `chmod u+x`
- **Ownership commands**: `chown`, `chgrp`, and `umask` for 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`, `visudo` for secure command execution

### Process Management

Process control concepts (lines 108–119) include:
- **Viewing processes**: `ps` for snapshots, `top` for real-time monitoring
- **Signal handling**: `kill`, `pkill` for terminating processes
- **Job control**: Background execution (`&`), `jobs`, `bg`, and `fg`
- **System calls**: The `fork` system 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 `systemctl` and the traditional `service` command, including the naming convention of `d` suffixes for background services (lines 122–132)
- **Package operations**: Using `yum` and `rpm` to 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`, and `atrm`; recurring jobs with `cron` (lines 84–92)
- **Network utilities**: Connectivity testing with `ping`, interface configuration via `ifconfig`/`ip`, connection monitoring with `netstat` and `ss`, and remote operations using `ssh` and `scp`
- **Log inspection**: System monitoring through `journalctl` and resource tracking with `iotop`

## Practical Examples from the Source Code

The repository includes runnable shell examples that demonstrate these Linux concepts in action.

### Listing Python Processes

```bash

# 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

```bash

# 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

```bash
#!/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:

```bash
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

```bash
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

```bash

# 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 text
- **[`README.md`](https://github.com/jackfrued/Python-100-Days/blob/main/README.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 `chmod` and `chown`, and navigation commands
- **System oversight**: Process control with `ps` and `top`, user management via `useradd` and `sudo`, and service administration through `systemctl`
- **Operational automation**: Package management with `yum`, task scheduling using `at` and `cron`, and network utilities including `ssh` and `scp`

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.