Shell script Real-Combat notes (4)--linux disk partition re-mount

Background:The default specified file directory for Hadoop's HDFs file system mount is/mnt/disk{n}. When operators, accidentally attached to the disk in other directories, such as/mnt/data,/mnt/disk01,/mnt/diska, HDFs will select the root partition,

Linux shell script output with color text

Linux shell script output with color textThe color of the text terminal can be generated by using the ANSI unconventional character sequence.Example: "Echo-e \033[44;37;5m BLUE \033[0m""Echo-e \033[44;37;5m BLUE \033[0m BLACK"The area that needs to

Arrays in the Linux shell and traversal

Transferred from: http://www.linuxidc.com/Linux/2011-09/42929.htmWhen using the shell under Linux, for convenience, an array is occasionally used. The way the array is declared is: array= (element1 element2 element3 .... elementn) That

Linux Shell Network layer monitoring scripts (monitoring includes: number of connections, number of handles, and analysis based on monitoring feedback results)

Script monitoring:The process that gets the maximum number of handles:Link Analysis:Script fragment:Case"$handle" inch2) echo"The handle of the process:"Echo" "Handle| Awk'{print $ "\ n" \ n "\ $7" \ n " $9" \ n "$11" \ n "}'>Temp forIinch' Cat temp

Methods to add users without a CMD command line: API Add Users and Shell.users

Before the HTML "TARGET=_BLANK>XP using the Control Panel CPL file left the back door, and then with the. cpl file Plus account technology, LCX really very powerfulToday, we studied the user Control Panel file nusrmgr.cpl, found that the call is

40. Common Linux Shell functions: mkdir, rmdir, and mount

1,Mkdir -M, -- mode = mode set file mode (as in chmod), not a = rwx-umask -P, -- parents no error if existing, make parent directories as needed Mkdir-P dir1/dir2 // IfDir1Does not exist, also createDir1 Mkdir-M 755/usr/dir3 // and setMode 2,

Exec in Shell

EXEC command in Shell 1.-exec parameter in find In the current directory (including subdirectories), find all TXT files and find the rows containing the string "bin" Find./-name "*. txt"-exec grep "bin "{}\; Delete all TXT files in the

Several tips in BASH Shell

1. for arithmetic operations. There are several assignment methods: Let a = 1 + 2Echo $ A = $(3 + 3 ))Echo $ A = $ [4*4]Echo "$" Set $ [A = 5*5]Echo "$" 2. Determine whether a directory exists:If [-d "$ (PWD)/.../candpointer"]; thenEcho "

Learning and using bash shell shortcuts

Learning and using bash shell shortcuts By fenng|It can be reproduced. During reprinting, it must be indicated by a hyperlink.ArticleSource and author information and copyright notice Web: http://www.dbanotes.net/techmemo/shell_shortcut.html This

Linux Shell advanced skills (3)

13. Format and output the current running process of the specified user: In this example, we pass the user list to the script in the form of Script Parameters. After the script reads the parameters, print the process of the user in the user list in

Powershell _ basic course _ 2_powershell and CMD and Unix/Linux Shell

Part 1ArticleI said that in order to change users' criticism on their console interface, Windows Vista started and planned to change this situation. The appearance of powershell. 1. compatible with shell commands To be compatible with

Linux Shell control statements

Control statement The following three methods are commonly used. A lower-case string represents a control command, while a lower-case string represents other meanings.1. If test then commands Elif test then commands fi2. for VAR in list do

Zenity: Add shell to graphical interface

Sometimes you can write your own gadgets and prefer non-graphic interfaces. However, some applications still bring up a reminder to let you know. Zenity is a very handsome thing. For its usage, refer to its -- help. I will not repeat it here. Here

Shell script Practice Notes (5) -- build an image server for resources

Background:Access to Site Resources outside China is sometimes very slow. an occasional download is certainly tolerable. It is a wise decision to build an image site for multiple use or internal use by a small team.This section uses the yum source

Code for reading and outputting data using shell commands

Shell scripts can read data in the following ways:1. keyboard input, default2. Read from the file3. Pipeline Command Transmission Echo functions:\ C: Do not wrap\ F: Paper Feed\ T: Skip\ N: line feed\ Indicates escape, for example: "\"/dev/rmt0 "\"

Two shell scripts for network card Traffic Statistics (using ifconfig)

Code 1: Copy codeThe Code is as follows :#! /Bin/bash # Network card Traffic Statistics # Link: www.jb51.net # Date: 2013/2/26 N = 10 DateRm-rf/tmp/ifconfig_logWhile ($ n> = 0 ))DoN = $ ($ n-1 ));Date>/tmp/ifconfig_logIfconfig

Shell script for monitoring disk usage (local + Remote)

Monitordisk. sh: Copy codeThe Code is as follows :#! /Bin/bash # Updated: PM By: leif (liangliwen@163.com) EMAIL =/usr/local/bin/email /Bin/df-h>/tmp/df.txt USE = 'df-H | grep-o [0-9] * % | grep-o '[0-9] \ +'' For I in $ USEDoIf ($ I> 95 ))Then$

Shell string operations (length, search, replacement)

Copy codeThe Code is as follows: Filename = '/home/admin/jobs/CnClickstat/DFSLoader/loader. cfg' # Use shell strings BuName1 =1 {filename # */jobs/} # Get 'cnclickstat/DFSLoader/loader. cfg 'by removing

How to use shell trusted CT

Don Libes, author of objective CT, made the following definition for objective CT when it was written in 1990: automated CT is a software suite for automatic interaction (Automated CT [is a] software suite for automatic interactive tools ). The

Chapter 5 Study Notes of Linux Command Line and shell script Programming

$ Cat test.txt line1line2line3line4 $ Sed-I '/line/{n; d}' test.txt $ cat test.txt line1line2line3line4 $ Sed-I '/line1/{n; d}' test.txt suzhaoqiang @ suzhaoqiang-OptiPlex-380 :~ /Android/source/linux_learned $ cat test.txt line1line2line3line4

Total Pages: 541 1 .... 235 236 237 238 239 .... 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.