Shell Exercises (iii)

Exercise 1:Batch Change file nameRequirements: Find all files with the suffix. txt in the/123 directory Bulk Modify. txt to. txt.bak Package all. bak files into 123.tar.gz The name of the batch restore file, that is, to remove

Write a shell script and execute it once

First the CD into a directoryTauch tset.sh//Create a new test.sh fileVim test.sh Edit ScriptI insert#!/bin/bashDataPress the ESC keyThen press CTRL +:Wq + EnterLs-l test.sh//view file permissions-rw-rw-r--1 Elasticsearch elasticsearch 18 February 8 1

Shell exercises (i)

Exercise 1: Generate a file every dayRequirements: please generate a daily file according to the date format (XXXX-XX-XX), for example, the file generated today is 2018-02-05.log, and write the disk usage to this file (do not consider Cron, just

Tai Hang record-shell script delete operation

BackgroundJenkins executes the shell command, which references some Jenkins variables, such as ${workspace}, because each execution of Jenkins is slow, so I want to copy the script to local debugging, directly copied the script to execute, the

Shell Special Symbols

First, shell special symbol Cut commandA command that intercepts a field: cut-D: followed by delimited characters, separated by single quotation marks-C: followed by the first few characters-F: The next section is followed by the number of blocks-D

DAY11 Shell Script Basics (enginner05-2)

Vi. condition testing and selection 6.1 test expression-file Status Test6.1.1 [-E file]File exists with a value of true;file does not exist as false6.1.2 [-D file]File exists and is a directory with a value of true;file does not exist as false6.1.3 [

Day9-1 Shell Basics

The shell is a command interpreter that provides user and machine interaction before Command historyPress UP ARROW key to appear before order historyHistory View Previous commandsThe command history exists in the file. Bash_historyThe maximum

A brief introduction to shell scripts

What I want to share with you today is the "shell script", one of the knowledge points I learned in the nineth day of operations, and I've seen the teacher write some simple scripts before class, when I felt that the script was a very tall thing,

Shell basic Syntax (i)

Composition + Execution Need to add #! at the beginning /bin/bash Lines that begin with # are interpreted as explanatory notes The name of the script ends with. SH and is used to differentiate between this is a shell script

Script for Shell script to bulk modify file name suffix

Experimental material:[[email protected] test]# ls//This directory contains all the files ending in. txt and requires all to be replaced by the. Doc End1.txt 2.txt 3.txt 4.txt 5.txtWriting scripts[Email protected] test]# vim/root/25.shScript content:

Shell Script--grep command for content lookup

The grep command retrieves the rows in the file that contain keywords (which can be used), and is case-sensitive by default.  Use the-c parameter to get the number of rows that contain the keywordUse the-n parameter to display the line number at the

Shell Script--Find command for file lookup

The first is to find the file name by using a-name parameter.Query for files ending in. txt, and files that begin with T :[Email protected]:~/test$ lsone.txt three.txt two.txt[email protected]:~/test$ Find/-name ' *.txt './two.txt ./one.txt./three.

Shell Exercises 20180119

Design a script that monitors the surviving state of a remote machine (assuming IP 123.23.11.21) and sends a message to yourself when it finds an outage.Tips:1. You can use the ping command: PING-C10 123.23.11.212. E-mail script can refer to: https:/

Shell Script--shift parameter left

What does it mean to move the parameter left? This parameter refers to the arguments that follow the script name when you run the script, you can use the $ #来获取参数的个数, use $* to get all the arguments, and the left side of the argument is this: there

Shell Pass Parameters

We can pass parameters to the script when executing the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to execute the script,

Linux System Shell Basics (iii)

I. Special symbols in the shellNumber: wildcard character, can match 0 or any number of characters? Number: Tan,#号: An annotation character that is followed by a command or parameter that does not execute\ No.: Raise the meaning of the instruction

Shell Basics (bottom)

Shell Special Symbols1.cut command:[[email protected] ~]# cat /etc/passwd |head -2 |cut -d ":" -f 1rootbin[[email protected] ~]# cat /etc/passwd |head -2 |cut -d ":" -f 1,2root:xbin:x[[email protected] ~]# cat /etc/passwd |head -2 |cut -d ":" -f

Shell Script--functions

The shell's functions are the same as Javacript and PHP's function declarations, except that when the shell calls the function, it can call the function simply by writing the function name, noting that parentheses are not appended to the function

VM in python2.7 run skier game, Shell restart issue!!!!!!

In the virtual machine Win7 system python2.7, the skier Game (code handwriting) in the parent and child is run in this Python,The following problems occur:================ restart:c:\python27\scripts\skier\skier.py ===================================

How to get started with Shell programming: how to get started with shell programming

How to get started with Shell programming: how to get started with shell programming Unlike Java, PHP, and other languages, the sh process control cannot be blank, for example: Public class Test {public static void main (String [] args) {int a = 10;

Total Pages: 541 1 .... 517 518 519 520 521 .... 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.