Bash Shell recursively implements file copy in directory

Preface to the work today encountered a problem, if you copy the file in directory A to directory B (premise directory B does not have the file), and maintain the structure of the file in directory A. The project focuses on the following:

Shell Basic Syntax

A Linux basic commands1.1. CP commandThe function of this command is to copy the given file or directory to another file or directory, which is very powerful.Syntax: CP [option] source file or directory destination file or directory1.2. MV

SHELL System File Integrity check

System Integrity Audit ToolThe shell script is as follows:The #!/bin/bash##  variable is first declared to use shopt -s -o nounset#  declaration #  build Date date=$ (date + '%Y%m%d%H %m%s ') #  join the approved directory           #Dirs =

A description of some of the common environment variables and parameter variables in the shell script and examples of simple shell scripts

Environment Variables $HOMEHome directory of the current user $PATHA colon-delimited list of directories to search for commands $PS 1A command prompt, usually a $ character, but in bash, you can use some more complex values. For

Shell function processing

Shell function calls are divided into two types:The first way, a bit like the C language Call function style, directly to the function of the execution of the result copy to the variable! However, the assignment process is not the same as the C

Shell Script string interception

Problems with the interception of shell strings:The Linux shell intercepts the first 8 bits of a character variable, with the following methods:1.expr substr "$a" 1 82.echo $a |awk ' {print substr (, 1,8)} '3.echo $a |cut-c1-84.expr $a: ' \ (. \ \).

Meaning of specific compliance variables in shell scripts

$# the number of arguments passed to the script$* displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be more than 9$$ the current process PID number for the script to run$! Process

Shell modified file name (ii)

I want to modify the file name similar to the following batch of files:Aa01_01.txtAa01_02.txtAa01_03.txtAa01_04.txtModified intoBb02_01.txtBb02_02.txtBb02_03.txtBb02_04.txtReplace the head of the file name.============================================

<linux command, editor and Shell Programming > Commands Section reading notes

Ctrl+u can delete rows under the shell, if this key doesn't work, try Ctrl+xCTRL + Z You can suspend a program without terminating the program, but you can suspend the program.This job can then be switched to the foreground by the FG commandCP

Shell script if, for, and while statements

(1) If statement[Email protected]:/mnt/shared/shellbox/shellif# cat shellif.sh #!/bin/bash# judgment string if ["$" = "Hello"]then echo "\$1= $ "fi# judgment number, if () mode can only be used under bash, not under sh if (>) then echo"

Automatic installation of LNMP system using shell scripts

#!/bin/bashCd/usr/local/src./installmysql./installnginx./installphp./installhaproxy./installkeepalivedtouch/usr/local/nginx/html/phpinfo.phpEcho-e "/usr/local/nginx/html/phpinfo.php#!/bin/bashCd/usr/local/srcTar zxvf cmake-2.8.5.tar.gzCD cmake-2.8.5.

The unreliable use of the shell Cat command causes hourly data in the Hive table to be missing for one hours every few days

Phenomenon: Hourly data in hive tables, which are missing one hours every few days, are found to fail when data aggregation cat is done, resulting in: Modify the script to do the following solution: # #merge 5min data into hour data                  

Basic syntax structure summary of Shell programming basics

First, conditional statements Simple conditionsif Then # When the condition is established, the content is executed;fi If the reverse is written, the meaning offiif Complex conditionsif Then # When condition is established, execute

Summarize your own 8 tips used in shell command line

Original blog, reproduced please indicate the sourceThe shell is the command interpreter.See which shells are supported by this system1 Tab Command completionThis can be used almost every time, for example, I have a file called file.txt, if only one

Shell Script--Add GUI interface to Rdesktop

You often have to connect to Windows remotely, so rdesktop is a must.Recently installed the Gnome interface of the CENTOS7, found that the Rdesktop command has been used to become rdesktop-vrdp, but can be used on the line.To add a GUI to the

Shell text filtering programming (11): paste command

Tag: script [Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]It can be seen from the literal that the paste command and the cut command have the opposite function. The cut command

Solve the Problem of garbled characters when using crontab to execute shell scripts

I wrote a shell script to maintain the test environment, used crontab Scheduling for scheduled execution, and encountered a garbled problem. The script runs directly in the shell environment without any questions.   The conclusion is that crontab

Passing arguments to a shell script

Any shell script you run has access to (inherits) the environment variables accessible to its parent shell. in addition, any arguments you type after the Script Name on the shell command line are passed to the script as a series of variables. The

Linux shell mac address conversion convert with sed, convertsed

Linux shell mac address conversion convert with sed, convertsed Convert 0024. b20b. 693f address to 00: 24: b2: 0b: 69: 3f 1. Separated by dots [Root @ hzswtb2-mpc ~] # Echo "0024. b20b. 693f "| sed-r's/\ B (..) (..) \ B/\ 1: \ 2/g; s /\. /:/G'00:

Use an automated shell script to find detailed thread information for CPU usage

Use an automated shell script to find detailed thread information for CPU usage After some interceptor code is added to the project, the CPU alarm shows that the CPU usage exceeds 100%; If you want to find out which code consumes too much resources,

Total Pages: 541 1 .... 195 196 197 198 199 .... 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.