Memo a few useful shell scripts

(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

Shell batch processing picture server

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

The use of the CD command in the shell script

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

A shell statistic code line number

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

Shell Chapter (ii)

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

Shell reads user input

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

How the shell adds content after the specified file location

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

awk basic usage of shell scripts

Script file:[Email protected]:/study/shell# cat awk_test.sh #!/bin/shawk_test_fun () {echo "\$0:" Echo $0echo "\$1:" Echo $1echo "\$2:" Echo $2echo "\$3:" Echo $3echo "Awk_test.txt content:" Cat Awk_test.txtecho "result of: ' akw-f\" \ "\

Shell Scripting Learning

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

Some operations after the shell is set to none

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

tiny4412 Serial drive analysis of nine---shell terminal

PengdonglinEmail:[email protected]Development Board: tiny4412adk+s700 4GB FlashHost: Wind7 64-bitVirtual machine: vmware+ubuntu12_04U-boot:u-boot 2010.12Linux kernel version: linux-3.0.31Android version: android-4.1.2In the above we know

Using shell scripts for text splitting

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,

Shell Small Command combat: Get the same network segment host

#!/bin/bash#test  alive  ipa=1while :d o    a=$ (($a + 1))      if test  $a  -gt 255    then break     else                 ip_addr=$ (ifconfig | grep inet | head -n 1 | awk  ' { print $2} '  | awk -F :  ' {print $2} ' | awk -f .  ' {print  $1 "." $

Kesioncms V6.5 Back Shell method

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

Shell scripts Delete backup file instances up to 30 days ago

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

"Shell" tar command details

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

Shell Script-tips

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)

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

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, shellsed

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

Total Pages: 541 1 .... 489 490 491 492 493 .... 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.