Shell Programming _ Implement Recycle Bin, avoid accidental deletion of files

The code is as follows:Download: Https://gitee.com/LoongWang/shellrecycling.git1#/usr/bin/EnvBash2 3 4 #定义5 #定义回收站目录6Recyclingdir='/usr/local/recycling/'7 #定义回收站log文件8recyclinglog='/var/log/recyclinglog'9

Shell Learning (i)

One, free of dense interaction--stdin1. Reading strings from standard inputsuch as: passwd--stdin heruguo246[Email protected] mnt]# passwd--stdin heruiguo246Changing password for user heruiguo246.123456 ---Input modified heruiguo246 user password is

Spoof common user Terminal shell script

Cat a.shfunction joke () {num=0people_list=$ (w | sed ' 1,2d ' | awk ' {print $} ') for user in $people _listdoif [$user! = "root "]then#echo $userinfo =$ (w | Sed ' 1,2d ' | grep "^ $user") pts=$ (echo $info | awk ' {print $} ') while:d oecho-e "\03

Shell Scripting Exercise 1

#!/bin/Bash while : DoRead-P">>>"user [["$user"="Q"]] || [["$user"="Q"]] &&Break [[-Z $user]] &&ContinueID$user &>/dev/NULL [[ $? -eq0]] &&Cat/etc/passwd|awk-F:'{print $, $NF}'|grep$user | |Echo "User not exist" DoneThe script implements the

The shell automatically log out of inactive users after a period of time in CentOS

By defaultShellis not timed out automatically, but it is sometimes necessary for it to automatically exit the terminal after a period of inactivity without an operation. 1. Create a file /etc/profile.d/autologout.sh :#

Shell Script Note (iii) mathematical calculations in the shell

Mathematical calculations in the shellOne, use square brackets#!/bin/Basha=tenb=c=res=$[$a * ($c-$b)] Echo $resIi. usage of BCBC Technology is actually a programming language that recognizes: numbers (integers and floating-point numbers)

Shell Introduction, Command History, command and file name auto-complete; wildcard and input \ Output redirection

Shell IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.There is a layer of things

Shell Introduction and basic usage

8.1:shell Introduction:The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, supports logical judgments, loops, and each user can have his or her own shell:The CentOS default shell

Linux Shell: File directory Operations and instances

This article describes the underlying file operations: Create, move, edit, delete files and foldersCommand and Case:mkdir Creating a Directory--Create two directories[Email protected]:~$ mkdir test2 test3--Create a new directory under Test1

Shell's most commonly used service script

fpm

Mission Requirements: Managing/USR/LOCAL/PHP7/SBIN/PHP-FPM-C in the simplest way/usr/local/php7/etc/php.ini This command includes starting a stop restartUsing technology: Shell Scripting Chkconfig Service ManagementImplementation process:1. Create a

Handling method return value problem in shell

Sync Post: http://blog.hacktons.cn/2017/12/13/shell-func-return/BackgroundWith Shell programming, custom functions are often required to write some tools for batch processing. In the case of more complex points, it may be necessary to return a value.

Shell Test Command

Shell Test CommandThe test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file. Numerical test Parameters Description -eq

"Shell"--Basic knowledge (2)

1. How shell scripts runCreate shell script files, usually ending with. SH (e.g. example.sh)The shell script works as follows: Add ' x ' Execute permissions (relative or absolute path execution) To invoke a script file using the bash or

CentOS Install fish Shell

For CentOS 7, run the following command with root user root :Cd/etc/yum.repos.d/wget Https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish: Release:2.repoyum Install FishFor CentOS 6, run the following command with

[Turn]-nohup-real shell background run

& Method:Unix/linux generally want to let a program run in the background, many use & at the end of the program to let the program run automatically.For example we want to run MySQL in the background:/usr/local/mysql/bin/mysqld_safe--user=mysql

Application of shell script learning advanced and regular expression

Sort order:-F: ignore character case-N: Compare numeric Size-T: specify delimiter -K: Specify to compare field ordinals after delimited-u: duplicate rows, only once Sort by the second row of values:$ sort-k2n SORT.TXTCCC 8aaa 11yyy 12

Shell Script Programming Learning notes (i)

First, the script formatVim shell.sh#!/bin/bash//Declaration script interpreter, this ' # ' is not a comment, the rest is a comment#Program://program Content description#History://Time and authorIi. Types of Shell variablesUser-defined variables:

Written question Shell

Enterprise Practice question 1: (Production actual case): monitor MySQL master-slave synchronization is abnormal, if abnormal, send sms or mail to the administrator. Note: If there is no master-slave synchronization environment, you can use the

Java connection SSH Execution shell script

Wrote a shell script on the Liunx, want to call this shell script through Java, do not know how to call, in the Internet said to use process this way, but my executive machine and my shell script is not the same computer, the boss said Java can

Java operation Linux, invoke shell command

Importorg.junit.jupiter.api.Test;ImportJava.io.BufferedReader;Importjava.io.IOException;ImportJava.io.InputStreamReader;ImportJava.io.OutputStreamWriter;ImportJava.io.PrintWriter;ImportJava.util.logging.Level;ImportJava.util.logging.Logger; Public

Total Pages: 541 1 .... 283 284 285 286 287 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.