Remove command exclude specified file in Shell environment

The file structure under the root directory is listed below +-root +-fileA.txt +-subdir1 +- a.txt +- b.txt +-c.txt +-subdir2 D.txt +-e.txt +-f.txt +-subdir3 +-subdir4 +- subdir5 +-subdir6 +-subdir7 +-subdir8

Shell condition test Statement, String test whether Apache is open

It took me 10 minutes to figure it out. = "and"-N "usage differences, make a note to smooth First method: Test if Apache is turned on? String test #!/bin/bash web= '/usr/bin/pgrep httpd ' If [-N "$web"]; $web whether the return value is empty

Linux Shell Learning: How to make a recording playback function script

Not long ago I saw two interesting commands in the book--script and Srciptreplay, which can record a terminal session in a file, that is, we can create a command-line video tutorial through a terminal session, or we can share session files with

A shell script

Add Nginx reverse Proxy according to the entry parameter#!/bin/bash#set-XLog_path= "./proc/logs/shellexecute.log"log_path_back= "./proc/logs/shellexecute.log1"Nginxbasepath= "/home/netnumen/ems/ums-server/utils/nginx/nginx-1.4.7"Nginxconfpath=

The difference between double-quoted and single quotation marks in shell scripts

Transferred from: http://blog.csdn.net/iamlaosong/article/details/54728393 Recently, to compile a shell script to process the data, you need to detect the existence of the data file, the file name contains the date, so you need to generate the date

Shell File Lookup command find

File LookupFind------directory------1. Search Conditions2, after the file search processing----------------1. Search Conditions 1.1) Matching of file names && Multi-condition name matchingYou can use regular expressions to match, and-a or-o in

Shell Programming Quick Start

Shell programming: For Hadoop programmers, it is often necessary to familiarize yourself with shell programming, because the shell can easily run program code.1. Shell file format: xxx.sh#!/bin/sh---The first line of the shell file must be written

Shell combat: Get column content in a variety of ways

I am not a professional Linux, usually do not work in Linux programming, self-learning some Linux shell programming, forget to learn, learn to forget, efficiency is not high. Today is the right to review it.Think of a scenario where you get a

Shell Programming Basics

Take a look at the logic operations in bash before you learn the basics of Shell programmingBash features multi-command executionCommand;command1 ... Sequential execution structureSelect the execution structure:Logical operation:VS: Logical

Shell writes Ngin startup script

#!/bin/bash[-f/etc/init.d/functions] &&. /etc/init.d/functionsPid=/application/nginx/logs/nginx.pidNginx=/application/nginx/sbin/nginxRed_color= ' \e[1;31m 'Green_color= ' \e[1;32m 'Yellow_color= ' \e[1;33m 'Blue_color= ' \e[1;34m 'pink= ' \e[1;35m '

A preliminary introduction to the shell

Introduction to the Shell under LinuxOverview:Each person after successfully landing Liux, the system will appear different cue symbols, such as $,~, #等, and then you can start to enter the command you need, if the command is correct, the system

HBase Learning Notes-hbase Shell common commands

Limit the number of rows when you sweep a table' table_name ' 5 }When the table is scanned, only five data is specified==============================================Delete TableThe deletion of the table requires the implementation of two steps,

Linux Shell Programming Learning notes---Chapter III

3.1 Regular Expression BasicsThe primary function of regular expressions is text query and string manipulation. is actually string filtering.Regular expressions include ordinary characters and metacharacters character, meta-character main, see the

Shell--wait and multi-process concurrency

Open multiple sub-processes in the script with & background, and use the wait command to make these sub-processes execute in parallel.Example 1:fun1 () {whiletruedoesecho1sleep1done }fun2 () {whiletruedoecho2sleep 1 Done &&WaitExample

Shell Script Installation Nginx

#!/bin/Bashn_url="http://nginx.org/download/nginx-1.8.0.tar.gz"N_pack=`Echo$N _url|awk-F'/' '{print $}'' N_upack=`Echo$N _url|awk-F'/' '{print $}'|awk-F'.' '{print $ "." $ "." $-$}'' N_dir="/usr/local/nginx"functionNginx () {if[ `WhoAmI` !="Root"];

The shell learns notes.

1. Semicolons separate multiple commands.2. There are no spaces in the middle of the variable assignment.3. When constructing pipelines, try to make the amount of data in each phase less. If the two tasks are not related to the order, then the

Shell--sample--Close Tomcat

#!/bin/Bashprocess_name="Org.apache.catalina.startup.Bootstrap"Shutdown_call=0functionShutdowntomcat () {process_pid=`PS-ef |grep "$process _name"|grep-V"grep"|awk '{print $}'` forIinch$process _pid Do Echo "Info:kill the Tomcat process [$

A summary of Shell judgment problems

#!/bin/bash#比如需要判断一个变量是否含有值:if [[ -z $1 ]] ; thenecho "Something like empty!"exit 0;fi#判断上一条语句是否执行成功if [[ "$?" -eq 0 ]] ; thenecho "$1 更新成功."exit 0;fi#下面再举一个实例NovaPath=”/home/malu/”NovaFile=”/home/malu/access.log”#这里的-x parameter determines whether $

Shell Script Debugging Tips

0. Standard format for professional scriptingFunction 1 function 2main function main $*1. Use the Dos2unix command to convert scripts developed under WindowsDos2unix is not installed by default and can be installed in Yum# Dos2unix web_jk.shdos2unix:

Several common sorting algorithms (bubble, select, insert, Shell, continued)

Take a look at several common sorting algorithms in the next two days.1. Bubble Sort MethodEach time the adjacent elements are compared from i=0, if arr[i]>arr[i+1], they are exchanged. Until the biggest element is pushed to the end. Go back to i=0

Total Pages: 541 1 .... 520 521 522 523 524 .... 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.