Linux Bash Shell build base script

Build basic script When creating a shell script, you must specify the shell to be used in the first line of the file. Its format is: #!/bin/bash environment variable Example: #!/bin/bash #display user information from the system echo "User info for userid: $USER" echo UID: $UID echo HOME: $HOME User variable The user variable can be any ...

Posted by Gafaddict on Sat, 05 Mar 2022 20:34:55 +0100

Firewall firewall policy details

Firewall firewall policy details 1, Firewall firewalld Firewall is Centos7 The default firewall management tool of the system replaces the previous one iptables In the firewall layer, packet filtering also belongs to the network. firewalld and iptables are tools used to manage firewalls (in user mode) to define various rules and functions o ...

Posted by bgbs on Fri, 04 Mar 2022 22:43:49 +0100

Linux learning assignment - settings of recycle bin

Linux recycle bin – create a simple recycle bin with a shell script Requirements to be met Write a script – myrm SH, delete files. It has the function of recycle bin. All deleted files are stored in / my_backup directory;Write a script that can recover deleted files_ back. SH, which can restore the deleted file to the original pat ...

Posted by Darkness Soul on Thu, 03 Mar 2022 21:32:04 +0100

Introduction to Shell programming

Introduction to Shell programming Symbols of references: Single quotation mark: WYSIWYG Double quotation marks: parse variables (treat the input as a whole) Backquotes: parsing commands No quotation marks: similar to double quotation marks Why learn Shell programming Shell will be widely used in Linux system, and we also need to ...

Posted by Salsaboy on Sat, 19 Feb 2022 13:43:00 +0100

Add existing source code into repo management

Add existing source code into repo management Applicable to the source code of non source code management (git/repo) in large projects preface ​ When the company is developing some projects, the code given from the supplier's original factory does not contain any source code management files. Many people need to cooperate in the developmen ...

Posted by ernielou on Fri, 18 Feb 2022 12:05:46 +0100

Linux based shell variables

1, shell variables and other related introduction 1. Compiled language and interpreted language Compiled language: compiled language is written before program execution. It needs a special compilation process to compile the program into machine language. For example, the exe format package of Windows. Interpretive language: interpretive la ...

Posted by gurroa on Fri, 18 Feb 2022 06:06:47 +0100

shell script -- Operator

Fundamentals of shell programming (shell script learning notes) operator Operators in Shell mainly include comparison operator (for integer comparison), string operator (for string test), file operation operator (for file test), logical operator, arithmetic operator, bit operator, self increasing and self decreasing operator, etc. 1. A ...

Posted by elie on Thu, 17 Feb 2022 21:40:37 +0100

Linux operation and maintenance -- several commonly used commands for viewing system hardware information

Here we recommend a free and convenient mall project: Source code through train > > > Under Linux, we often need to view the hardware information of the system. Here I list the practical commands for viewing the hardware information of the system, classify them and explain them with examples. Execution environment: ubuntu 16.04 1. c ...

Posted by Digwood on Thu, 17 Feb 2022 21:01:43 +0100

Loop nesting and extension of shell (function)

1, Random number 1. Practical cases: Write a script to generate a phoneNum Txt file, randomly generate 100 mobile phone numbers starting with 139, one line for each analysis Generate 100 phone numbers, and the script needs to cycle 100 times139 + 8 bits, the last 8 bits are generated randomly, which can generate every d ...

Posted by astronaut on Thu, 17 Feb 2022 17:00:20 +0100

Linux common command learning

Linux common command learning 1. ls command It is the abbreviation of list. Through ls command, you can not only view the files contained in linux folders, but also view file permissions (including directory, folder and file permissions)  view directory information, etc. Common parameter collocation: ls -a List all files in the directo ...

Posted by linusx007 on Tue, 15 Feb 2022 04:22:53 +0100