(1) under the shell, operate the Hadoop directory, batch name or delete, the final command sed the regular greedy replacement, look at the following script:Java code
# traverse the file name under the Hadoop directory
for line in ' Hadoop
Recently the leader has given a task to deal with the line-piece server, unwanted pictures to remove it.Idea: First the line to use the image from the database to export, the table has a picture path, and then the path to generate a txtFinally, each
When writing the shell script to find that the CD switch directory can not switch, the code is the following.1 #!/bin/bash2#changedir. SH3history4 cd/home/ Firefox516 pwdI think carefully, I carry out the time is. Changedir.sh to execute, so that
Xcode statistics code, with the shell command can be very simple. Open the terminal, enter your project directory, execute the following codefind . -name "*.m" -or -name "*.h" -or -name "*.html" -or -name "*.c" |xargs wc -lIf you want to count iOS
There are many shell types in Linux, common: Bourne shell (/user/bin/sh or/bin/sh),Bourne Again Shell (/user/bin/bash or/bin/bash),C Shell (/user/bin/csh or/BIN/CSH),TC Shell ((/user/bin/tcsh or/BIN/TCSH).The Bourne shell (i.e. sh) is the first
Use the read command when you need to get input from the scripting people during the execution(1) Basic readingThe read command accepts standard input or other file descriptor input. After reading the data into a standard variable.- p allows you to
Recently encountered a problem in the work, want to add a flag bit after the specified location of a file, required to be implemented in the shell script.Problem Description:Want to add a flag after a string of sys_config.fex textFor example, there
The format of writing shell scripts with vim or VI is fixed, as follows: #!/bin/sh#commentscode #! tells the system that the program specified after the path is the shell that interprets this script file. If there is no such sentence in the first
Package com.yc.utils;Import java.sql.SQLException;public class Shellutil { Private Boolean flag=false; private int xx; The x-axis of the mouse position when you click the interface private int yy; The y-axis of the mouse position when you
Requirements DescriptionIn bash, we can easily split the text using the split command. Now add two points of demand:1. Insert title at the head of each split file for easy viewing.2. The name of the split file is numbered before the source file name,
Title:kesioncms V6.5 Back Shell method--2011-03-29 00:21Recently get a site, is kesioncms V6.5 Web system, try to take Webshell method under the background, write down.1.The new x.asp user, combined with the IIS folder Resolution vulnerability, is
According to company requirements, delete the server 30 days before the file, the following is the script:#vi del-30.sh#!/bin/bashlocation= "/mpgdata/"Find $location-type f-mtime +30-exec rm-f {} \;#chmod +x del-30.shDescription:/mpgdata/is the path
tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the
1. Internal parametersThe above process is an internal variable, which is required to represent the program itself, and $ $ is optional. The same internal variables as $ A are as follows.$#----The total number of parameters passed to the program is $
Execute the system command and write the shell script that writes the output to the specified log file (2)
The previous article was a simple script that can be executed and written into logs. However, if it is placed in the production environment,
Use of shell (1) variables in Linux, linuxshell
One Variable
Echo $ a: output variable a. If it does not exist, a variable a is created.
Unset a: Cancel variable
1.1 environment variables:
Env: View descriptions of environment variables and common
Introduction to Sed Regular Expressions in Linux shell scripts, shellsedSed IntroductionSed is a lightweight stream editor, short for stream editor. Sed is also called a row editor because it is used to edit a file in a behavior unit. It can
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.