Shell script automatically frees up space script in Linux

System: CentOS 5.xScript content: The code is as follows Copy Code Cat make_room.sh#!/bin/bash#size = ' Df-hp|grep/dev/mapper/volgroup00-logvol00|awk ' {print $} ' |cut-f 1-d ' G 'Size= ' Df-mp|grep/dev/mapper/volgroup00-

Shell Programming Case Statements

Bash Script Programming:Case statement:Multi-Branch If statement:if CONDITION1; ThenBranch 1Elif CONDITION2; ThenBranch 2...else CONDITION; ThenBranch NFiExample 1: Display a menu to the user;CPU) Display CPU informationMEM) Display Memory

Keepalived+nfs+shell Script Implementation Nfs-ha high availability

Originally wanted to do drbd+heartbeat, but the leader said to add hard disk waste of resources, not necessary, and in the existing hard disk to do a large risk, so it can only use rsync to achieve data synchronization, the experiment found a lot of

A simple shell tutorial

Shell TutorialsThe shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language.A Shell is an application that provides an interface through which users access the service

Shell-Related Tips Summary application (1)

1. Run the command as a specified userRunuser-work-c "Cd/home/work/uc/bin && sh start.sh"Runuser-push-c "Cd/home/push/mucs/bin && sh start.sh"Or:Daemon--user mongod "Mongod--config conf/mongod.conf"Daemon is a function name that needs to be

Log Analysis _ use Shell full log analysis case

First, demand analysis1. Log files are generated each day (the log files need to be uploaded to HDFs) 2. Analyze the fields included in the log file: Access IP, access time, access URL, access status, access traffic3. There are now "yesterday" log

How do I write a shell script without human intervention?

When using some basic shell commands, the machine needs to interact with the person to determine the execution of the command. such as CP Test.txt Boo/test.txt, will ask whether to overwrite? SSH remote login, you need to enter a manual password

Lao Li share: "Linux shell Script Raiders" Essentials (VI)

1. Print Network interface list[touch_more]# ifconfig | cut-c-10 | Tr-d ' | Tr-s ' \ n 'Eth0Lowww.qixoo.qixoo.com//cut-c-10; The first 10 characters of the output;Tr-d "; Delete all spaces;Tr-s ' \ n '; Compress repeated line breaks2. View Name

Linux Shell script Programming--cut command

CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of

Linux Shell if parameter

Used in shell programming to determine parameters within an if statement–b return True when file exists and is a block file-C Returns True when file exists and is a character-D returns True when pathname exists and is a directory-E Returns True when

Shell date plus minus

Shell date Plus and minus operations such as today is 2012-04-22$ date-d "+1 Day" +%y-%m-%d2012-04-23 $ date-d "-1 days" +%y-%m-%d2012-04-21 $ date-d "2012- 04-10-1 Day "+%y-%m-%d2012-04-09 $ date-d" 2012-04-10 +1 Day "+%y-%m-%d2012-04-11 $ date-d"-1

Shell Condition Test Summary

Condition test: Recommended format 2Format 1:test man test See Related HelpFormat 2: [Format 3: [[Description: A wildcard character can be used for pattern matching in [[]] && | | > [[email protected] ~]# test-f file && echo 1 | | Echo 00[[email

Bourn Again Shell Programming

The shell is both a command interpreter and a high-level programming language. The shell is an interpreted language. The creation and operation of bash scripts: Comment Lines start with ##! The following parameters tell the system to

Shell echo Command

Echo is an internal command of the shell that prints the specified string on the screen. Command format: Echo Arg You can use echo to achieve more complex output format control.Show escape characters echo "\"It is a test\ ""

Shell Script Raiders (learning notes)--1.3 Command logical execution order

You can use the semicolon ";", the double ampersand "&&" and the Double vertical bar "| |" in Linux To connect multiple commands.1.3.1 Semicolon;When multiple commands want to be executed at the same time on a single line, a semicolon ";" can be

Ways to allow FTP users to log in and disable shell logons

Recently installed VSFTPD to do FTP service, found that the system user login shell is set to/sbin/nologin, you cannot use the FTP service. Online data said that VSFTPD will be for each FTP login user to check the corresponding login shell

Shell script, how to implement every time a new shell is opened to output a prompt?

[Email protected] wyb]#CatTest.SH Echo-E"\033[32mhello,this is Wangyuebo ' s shell\033[0m"Echo-E"\033[32m ' Date ' \033[0m"LANG=enEcho-E"\033[32m ' Date ' login at ' hostname ' W ' \033[0m">>/etc/Wangyuebo.log[[email protected] wyb]# when the cue is

Shell condition judgment

1. string Judgments STR1 = str2 True when two strings have the same content, length Str1! = str2 True when strings str1 and str2 are unequal -N str1 True when the length of a string is

Fifth chapter shell functions and Arrays

5.1 FunctionsFormat:Func () {command}Example 1:#!/bin/bashfunc () {echo "This is a function."} Func# Bash Test.shthis is a function.The shell function is simple, with the function name followed by a double parenthesis and the double curly brace.

Array of shell scripts and Yum "Down"

Array of shell scripts and Yum "Down"ArrayVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variables.Array name and IndexIndex: Numbering

Total Pages: 541 1 .... 226 227 228 229 230 .... 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.