Linux shell command

Cat/proc/meminfoCat/proc/cpuinfoIpcs-aIpcs-mIpcs-sIpcs-qMkdir-p name when the parent directory does not exist is to create itINFOCMP VT100Echo $TERMXtermKonsoleGetconf Long_bitArchRelease= ($ (Lsb_releaseCD-RZ szecho $PS 1Ls-f (after the directory

Redirection of Linux shell code blocks

Code block redirection refers to redirecting standard or standard output to a file within a block of code, or leaving the default state outside of a block of code, in other words, code block redirection refers to the redirection of standard input or

Linux Automated Format partitioning method (non-interactive, can be used for Shell scripting)

Automated Format Partitioning method ---- non-interactive --- available for scriptingTo give the user a hint first, let him select a partition to formatFor i in ' mount|grep '/dev/sdb ' |awk ' {print '} 'Dofuser–km $i; Umount $iDoneDD If=/dev/zero

Linux Shell Common Tips (10)

Twenty. To get the system run data through the pipeline Combination shell command :1. Output the 5 most memory-intensive commands in the current system:#1) Lists all the processes that are running on the current host through the PS command.#2) The

Linux shell pushd popd dirs Command

1, dirs1) Functiondisplays all records in the current directory stack (the dirs command with no parameters displays the records in the current directory stack)2) Syntax(1) format: dirs [-CLPV] [+n] [-n](2) Options-C Delete all records in the

Part of Linux shell scripting exercises (ii)

While Condition;doStatementDoneEnter loop: Condition satisfiesExit Loop: Condition not satisfiedUntil Condition;doStatment...Done#!/bin/bash#Read-p "Input Something:" STRINGwhile[$STRING! = ' quit '];d oecho $STRING | Tr ' A-Z ' A-ZRead-p "Input

Shell programming (15th) --- special while usage and functions

Break: exit the loop body continue: ends this loop and enters the next loop.Special usage of while 1: While: dodone the above is an endless loop of while.Special while usage 2: While read linedodone Function: FunctionSyntax format: Method 1:

Shell scripts refresh data without line breaks

#! /Bin/bash While[1] Do A = $ (ifconfig eth0 | grep'Rx PAC'| Awk'{Print $2 }'| Awk-F:'{Print $ NF }') Echo-ne"$ A \ r"# Refresh data without line breaks Done Echo Parameter number:-N. Do not wrap the line at the end.-E

Shell script Practice Notes (6) -- Cluster Environment configuration Detection

  1). Background:During cluster deployment, consistent configuration and environment settings are required. for Virtual Machine clusters, you can copy, copy, and restore cluster machines by using images. different from physical machine clusters, if

Comments and assignments in Shell

1. Single line comment: # echo "Hello World"2. Multi-line comment:: Tar cvzf $ databak_dir $3 $ date '. SQL' using databak_dir%3%date'.tar.gz '> 2> & 1SCP export databak_dir%3%date'.tar.gz '[email protected] "":/DIR # transfers backup files to

Shell operations of HDFS

Since HDFS is a distributed file system for data access, operations on HDFS are basic operations on the file system, such as file creation, modification, deletion, and modification permissions, folder creation, deletion, and renaming. Pair HDFS

Bash/Shell mathematical computing

$ echo $((20.0/7))$ zcalc$ bc REF:http://unix.stackexchange.com/questions/40786/how-to-do-integer-float-calculations-in-bash-or-other-languages-frameworks

Shell script parsing 9 (Exercise 3) ------ reverse output

#! /Bin/bash # Prompt user input Echo-n "Please enter number" Read N # Put the input value into Variable N SD = 0 REV = "" On = $ N # Save the value of Variable N to the variable on for later use Echo "you put number is $ N" While [$ n-GT 0]

Shell script execution and basic knowledge

After we grant the shell script execution permission, we can test the program. Assume that the shell script file is hello. Sh.In the/root directory. The following describes how to execute shell scripts on a terminal:1. Switch to the directory where

Special shell Variables

Man Bash: Special ParametersThe shell treats several parameters specially. These parameters mayOnly be referenced; assignment to them is not allowed.* Expands to the positional parameters, starting from one. WhenThe expansion occurs within double

Prevents shell from running multiple

I am often very lazy. The main solution to laziness is to use scripts for automatic execution. However, sometimes, for example, processing a piece of data has not been completed, and the next execution starts again, this is a problem. Let's see how

Several bash shell examples

? Time when the file is read #! /Bin/bash For file in 'ls/root' Do Stat $ File> 1.txt Sed-n "7 P" 1.txt> 2.txt Usetime = awk-F ":" '{print $2}' 2.txt Echo "time =" $ File $ usetime Done ? The while statement that reads each row of a file. Cat afile |

Analyze Apache Log Status Codes Using shell scripts

1. First, cut Apache logs by day VI/etc/httpd/CONF/httpd. confErrorlog "| rotatelogs/var/log/httpd/% Y % m % derror_log 86400 480 ″Customlog "| rotatelogs/var/log/httpd/% Y % m % daccess_log 86400 480" combined Ii. Restart Apache server Service

Email Alert shell script

Note: you must first install an email server such as Postfix or Sendmail. 1. Apache #!/bin/bash#apache.shnc -w2 localhost 80 if[ $? -ne 0 ]thenecho "apache is down,please check" | mail [email protected] -s "apache is

Shell Command Line shortcut

In the shell command terminal, Ctrl + n is equivalent to the downward direction key, and Ctrl + p is equivalent to the upward direction key. You can use them or the arrow keys in the Command terminal to quickly find historical commands. This is

Total Pages: 541 1 .... 480 481 482 483 484 .... 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.