Common shell commands under Linux

1. Export Env_var=value #修改环境变量2. Env #查看环境变量值3. Hostname #显示主机名4. readlink-f filename #文件的完整路径5. Tar xzf filename.tar.gz; #解压, followed by the-C dirname, means to extract to a directory.6. Tar czf filename.tar.gz dirname #压缩7. Ctr+r use keywords to

Shell script, a classic topic.

[Email protected] wyb]#CatZhuijiu.SH #!/bin/bash#1, write a script execution, enter a name, generate a random number 01-the number between 99. #2, if the same name repeated input, the captured number is the result of the first crawl, #3, the number

Linux Shell (SSH bulk configuration secret) read the configuration file for remote operation

Requires the target machine to have the expect command installedDivided into five files config.ini (config file), id_ras.pub (public key), read.sh (a function for reading the configuration file), test.sh (execution file), run.sh (remote run script)

Linux Shell Programming

1. Batch add user's small script:1 for inch XP WRG LCT 2 Do 3 Useradd $name 4 Echo passwd --stdin $name5 DoneTo echo Red | Explanation of the passwd--stdin $name:First, the commands before and after the pipeline are not sequential. PASSWD is

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

First knowledge of the shell

1. What is a shell?The shell is in the outer layer of the kernel, which is responsible for receiving commands entered by the user, interprets the commands as kernel can understand, then executes by kernel and returns the results back to the default

Linux Shell Learning Summary

1.-bash:./dd.sh:/bin/bash^m:bad Interpreter: No file or directoryWhen the above problem arises, first look at your. Profile is configured correctly, the general configuration is: path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbinNote The general

Shell Configuration Environment variables

When we use the Xshell development machine, we often encounter some problems, such as the use of certain commands he will command not found, the reason is that we have to configure the environment variable, so that can be accessed in any path.This

Shell Script-Regular expression

character class (Character Class): The above example x and y, which represent one character in the pattern , but the range of values is a class of wordsAny one of them.Quantity Qualifier (quantifier): each part of a mail address can have one or

Eval in the shell

Eval syntaxEval arg1 arg2 ...The function of Eval is to take the following parameters Arg1 Arg2 and so on as a pipeline, and then re-execute the shell process pipeline (about pipeline, see http://www.cnblogs.com/chaoguo1234 /p/5724321.html)Suppose

How the shell generates RPM package warehouse list file comparison results

Basic steps:1. Switch to the warehouse directory Rpm_list_dir1 and RPM_LIST_DIR22. LS lists the RPM package files of the warehouse and redirects them to the output files Rpm_list_file1 and Rpm_list_file2 respectively.3. Output the comparison results

My shell script

Problem: There are 600 IPs in the ip.lt file, 3 document templates, and three document name structures are "ip+ series of Strings", Requirements: 1. Divide 600 IPs into 3 points, create 600 documents based on three templates, same name structure as

Casing conversion in Shell

There are two ways of doing this:1, with TRExample: uppercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE lowercase to uppercase)lowercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE uppercase to lowercase)2, with

The progress bar and maximum minimum average under the shell

Progress barC Language progress bar reference my original article blog-> progress barFunction proc () {     i=0      str= '       arr= (' | ')   '/'   '-'   ' \ \ ')      index=0     while [   $i  -le 100 ]     do          printf  "[%-101s][%d%%][%c]

9. Shell Environment

• printenv– Print Some or all of the environment variables• set– set shell options• export-Export the environment variables so that the program that is executed later knows.• alias– create command aliases1.shell Environment: The shell maintains a

Parentheses and instances in a shell script

1, single parenthesis and double parenthesisThe double parenthesis command allows advanced mathematical expressions to be put into a comparison. The format is as follows:((expression))In addition to the standard mathematical operators used by the

Shell script Programming--if statements

How to handle the programming logic:1, sequential execution2, select Execute3, loop executionConditional Select if statementSelect Execute:Note: If statements can be nestedSingle Branchif judgment condition; thenBranch code with true

Java Remote Call shell

Import Java.io.BufferedReader;Import Java.io.ByteArrayInputStream;Import Java.io.File;Import Java.io.FileOutputStream;Import Java.io.InputStream;Import Java.io.InputStreamReader;Import Java.io.OutputStream;Import Java.nio.charset.Charset;Import java.

Arrays-Introduction to basic usage in shell scripts

Shell scripts are extremely important in operations, and the use of arrays in shell scripts is a very useful aspect in both looping and computing.Here are some operations on the array aspects of the shell script to record here, hoping to help

Add the jar that the user needs when starting with cluster mode in Spark-shell

Want to test the Elasticsearch operation of cluster mode in Spark-shell,# 1 Download the relevant jar first# 2 Use--jars when starting Spark-shell./bin/spark-shell–master Spark://master:7077–jars/usr/local/spark-1.6.2/lib/elasticsearch-spark_2.10-2.2

Total Pages: 541 1 .... 467 468 469 470 471 .... 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.