${}, # #和 in the shell

Suppose we define a variable as:Copy the Code code as follows:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:Copy the Code code as follows:${file#*/}: Delete the first/its left string:

Custom shell terminal prompt and color (for CentOS as an example)

Linux Modify shell command prompt and color1. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as follows:[Root@~/wade/

Linux Shell Programming-character intercept commands

01. Field Extraction Command Cut + = cut [option] file name-F Column Number: Extract the first few columns-D delimiter: Splitting columns by the specified separatorFor example: Cut-f 2,4 (column number;, comma can extract multiple rows)

Linux Base shell script problem

1. Write Script/root/bin/sumid.sh, calculate the sum of the ID of the 10th user and the 20th user in the/etc/passwd fileSolution: vim/root/bin/sumid.sh#!/bin/bashTenuser= ' cat/etc/passwd | Head-n10 | Tail-n1 |cut-d:-f3 'Twentyuser= ' cat/etc/passwd

Shell Foundation One

Shell Basicsfirst, what is the shell1. is a command interpreter that provides interaction between the user and the machine2. Support for specific syntax, such as logical judgment, looping3. Each user can have their own specific shell4. Default to

Shell programming, backing up files across servers

Requirements: Query all files under a folder, change the file modification time to less than the current time, and be larger than the current time the previous day of the file backup to another server corresponding to the folderIdeas:1, recursive

Initial knowledge of Shell programming

I. Basic introduction to Shell programming 1.1shell programmingThe shell is an interface that the user interacts with the kernel, and the most popular shell is now called the Bash shellThe shell is also a programming language interpreted

Linux Shell Programming

Shell Programming Concepts(1) Shell is a command-line interpreter, there are many kinds of shells(2) The shell as a bridge between the Linux kernel and the user, the user by default cannot directly manipulate the kernel(3) can be operated through

Shell special symbol, cut command, sort_wc_uniq command, tee_tr_split command, Shell special symbol

Shell Special Symbols* Any of any characters[[email protected] ~]# ls *.txt1.txt 23.txt 2.txt David.txt? Any one character[email protected] ~]# ls?. Txt1.txt 2.txt# comment Characters[[email protected] ~]# #echo ' OK '\ de-Semantic characters[Email

Linux-shell series 7-ssh key generation distribution

Sshpass This software is for SSH to provide a password to useYum Install sshpass- yBulk distribution of script content#!/bin/bash. /etc/rc.d/init.d/functions# Create key\rm ~/.ssh/id_rsa*-FSsh-keygen-t rsa-f ~/.ssh/id_rsa-n ""-Q# Distributing

Shell Script Data Cleansing

The task to be done is to process files of a similar format and extract each month and day to the end of each line (cleaned)The idea is to first use the cut command to each line of the month and day of the hour to extract, give a variable, and then

Jenkins executes the shell command, sometimes prompting "command not found"

The problem is that environment variables are not accurately(1) Check that the maven you set in Jenkins is accurate, and you can see if there is a MAVEN option in the new job with the "New Job" button, not exactly what you configuredIf you download

Shell Scan IP Segment

#!/bin/shdomain= ' echo $1|awk-f '. " ' {print $ '. $ "." $ "."} ' ' Start_ip= ' echo $1|awk-f "." ' {print $4} ' end_ip= ' echo $2|awk-f '. " ' {print $4} ' echo ' domain is $domain ' function Scan () { ping-c 1 $1$2 >/dev/null && echo "$ is

Write a simple configuration file and log management (shell)

Recently in the design of a Linux system scenario, write a configuration and log management of the upgrade service program.A total of 4 files, Server a updateserver.conf configuration file and a updateserver script, a updateclinet.conf configuration

Shell finishing (===date) small script for command

(a) accept an input, judging is not a date, the user's input can be 2017-10-1 or 2017.10.1 or 2017/10/1The shell code is as follows#!/bin/bashRead-p "Input:" DateA= ' echo $date | Awk-f ' [./-] ' {print $ '/' $ '/' $ $} 'Date-d $a &>/dev/nullIf

Shell programming-common file handling commands

Touch commandThe touch command is used to create empty files, such as when an application wants a log file to exist before they can write to the data. You can create an empty file with the touch command: touch test1 ;The touch command can also be

Shell grooming (31) = = = A small example of common year leap year and nested loops

Topic (i)There are 1 2 3 44 digits, any combination of how many different and no duplicates of the number, what is the difference?The shell code is as follows:#!/bin/bashFor i in ' seq 4 'DoFor x in ' SEQ 4 'DoFor y in ' seq 4 'Do[$x-eq $i] &&

"Linux series", "Basic Edition", chapter fourth, the regular expression of Shell Foundation

Regular expressions for 4. shell Basics     4.1  Regular strings are a string of rules          4.1 grep             4.1.1  Format: grep [-cinrvabc]  ' word '  filename             4.1.2 -c //count, indicating number of rows           

Ansible + Shell Implementation Fastdfs+nginx implement picture Server and provide dynamic zoom function;

Because the company Ali server changes several times, manually deployed several times Fastdfs+nginx, so think of the automated deployment, the following is the script content, because just want to implement the function, has not completed the

Shell---rpm

gpg

[Email protected] src]# RPM-QPL epel-release-latest-6.noarch.rpm # #查询该rpm包安装了什么Warning:epel-release-latest-6.noarch.rpm:header V3 rsa/sha256 Signature, key ID 0608b895:nokey/etc/pki/rpm-gpg/rpm-gpg-key-epel-6/etc/rpm/macros.ghc-srpm/etc/yum.repos.d/

Total Pages: 541 1 .... 162 163 164 165 166 .... 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.