280 Essential Shell Scripts Every Linux Engineer Should Master

A good summary of knowledge can help everyone quickly learn and improve relevant skills.When learning Linux, shell scripting is an indispensable knowledge system. To help everyone quickly get started and enhance their shell programming skills, I have compiled 280 classic shell scripts. It can be said that any qualified Linux engineer has gone through this … Read more

How to Run Python Scripts? A Step-by-Step Guide with 2 Methods for Beginners!

How to Run Python Scripts? A Step-by-Step Guide with 2 Methods for Beginners! 💻 After writing Python code, how do you get it to run? It’s actually super simple! Whether it’s the “right-click” method for beginners or the “terminal command” method for professionals, newcomers can learn both in just one minute! Both methods are taught, … Read more

Learning Python 3.x【2】

4 Introduction Python is a high-level scripting language that combines interpretive, compiled, interactive, and object-oriented features. Python’s design emphasizes strong readability, often using English keywords and a unique syntax structure compared to other languages. ① An interpreted language: This means there is no compilation step during development, similar to PHP and Perl. ② An interactive … Read more

Script for Adding New Users in Linux

Modify the following fields: Change username to the desired username; Change usergroup to the desired user group; Change userpwd to the user’s home directory; After renaming the file to <span>user.sh</span>, execute the script. #!/bin/bash groupadd -g 1102 usergroup && useradd -u 1102 -g username -d /userpwd -c "userremarks." -m -s /bin/bash username echo "userpassword" | … Read more

Linux(18): Creating Bash Scripts

Linux(18): Creating Bash Scripts

1. Core Purpose & Concepts Core Purpose: To write a series of Linux commands that need to be executed in order into a text file, creating a “script”. By running this single script file, a multi-step task can be automated without manually entering each command. Core Terminology: Bash Script: A plain text file containing a … Read more

Linux Data Cleanup Tools

Linux Data Cleanup Tools

In Linux, it is sometimes necessary to regularly delete files or directories that are outdated. The following script can be used for scheduled execution, and those who need it can use it directly.Script content (only deletes files under the directory) #!/bin/bash# Path: /opt/testBASE_DIR="/opt/test" # Get the year and month of last month (format: YYYY-MM)LAST_MONTH=$(date -d … Read more

Advanced Linux Techniques for Cluster Deployment (Part 7)

Advanced Linux Techniques for Cluster Deployment (Part 7)

Having read my previous articles, I believe everyone has mastered some basic command usage. Today, we will continue discussing how to manage a cluster using Linux commands. This falls under advanced Linux command techniques, where the focus is not on learning more commands but rather on combining and applying the commands we have learned previously. … Read more

Linux Shell Variables: A Comprehensive Guide from Beginner to Expert

Linux Shell Variables: A Comprehensive Guide from Beginner to Expert

Note: This article is an original work by Liu Feng from Anyatech. Please respect intellectual property rights. When sharing, please indicate the source. No plagiarism, adaptation, or unauthorized reproduction is accepted. Introduction In the Linux world, Shell variables are like the “soul of scripts”. They may seem simple, but they carry out core tasks such … Read more

Ansible Series Tutorial (3): Introduction to Playbooks and YAML Basics

Ansible Series Tutorial (3): Introduction to Playbooks and YAML Basics

Introduction in one sentence: Playbooks are the core of Ansible, describing tasks using YAML, making automation repeatable and maintainable. 1. What is a Playbook? A Playbook is like a “script” for Ansible, defining a series of tasks to be executed in a YAML file and specifying on which hosts to execute them. Its characteristics are: … Read more

Pydoer: A Lightweight and Easy-to-Use Python Module!

Pydoer: A Lightweight and Easy-to-Use Python Module!

The most frustrating part of scripting is getting “stuck on the third line”: incorrect file paths, missing dependencies, or logs without color. Pydoer acts like an on-demand operations partner, turning the “download-install-start-stop-clean” pipeline into 5 Python statements. Students in the lab and programmers in coffee corners can run the entire process with a single command. … Read more