Example of shell generation random password in Linux

To generate a more unordered and complex password, write a script that generates a random password, which is usually done by using the following commandCat/dev/urandom | Head-n 1 | md5sum | Head-c 16All right, no, no, just go straight to the script.

Use Shell to monitor site status in Linux

Today to their own web site to write shell monitoring, to avoid the site hanging I do not know, the script is to check the status of the Web page and Web Connection time, but also according to their own needs to expand, very powerful.Script

Shell REDIRECT Input

#!/bin/Bashnc_start="NC 192.168.76.227 9999"LOOP=100000 for ((i=0;i)) Do eof$ieof DoneThe above example is an example of a call to the NC command to send data to a listening port.Here Nc_start is just an example, before EOF is a variable name

For, while, until in the shell

for var inch List Do CommandsdoneIn each iteration, the variable var contains the current value in the list, the first iteration uses the first value in the list, and the second one uses the second value.In do and done, the $var variable

Shell programming 100 lines per day

[Email protected] ~/tscripts $ echo"Hello World!"-bash:!": Event not found[Email protected] ~/tscripts $ echo'Hello World!'Hello World![email protected]~/tscripts $ echo'Hello World!'>>t1.sh [email protected]~/tscripts $ cat t1.sh #!/bin/Bashhello

Shell Judgment Statement--Example interpretation

1 if statementThe format of the IF statement:If condition then command fiIf condition then command else command fiIf condition then command elif condition then command else command fiExample:Determines whether the current user is root, and if so,

Special symbols in the shell

* Multiple? 1 x# annotation Characters\ de-Righteous characters| Pipe character$ as a prefix for variables, used for variables!$ using the last parameter of the previous command; Used in the middle of two commands to write in one line~ User's Home

Shell's For loop

To the basic structure of the For loop:The condition of the for variable name in the loop;CommandDoneExample 1[email protected] ~]# cat for1.sh#/bin/bashFor i in ' SEQ 1 5 ';d oEcho $iDoneThe "condition of the loop" here can be written as a set of

Linux Shell Self-priming script notation

# **********************************************************************# Description of the Linux shell self-startup script #: # When we are doing the system, writing from the startup script is often the case, the following is a sample analysis. ##

Linux-shell Exercises (I.)

1, realize the bulk add 20 users, the user name is user1-20, password is user+123#!/bin/Bashcount=$1if[-N"$count"]then for((i=1; i)) DoUseradd-d/home/user_$i-s/bin/bash user_$i; Echo User_"$i"123|PASSWD--stdin user_$i; DoneElseEcho"$count is

[Shell] Swoole_timer_tick and crontab combination for scheduled tasks and monitoring

There are three main steps to completing tasks and monitoring manually:1. mission_cron.php (timed automatic task script):PHP /* * * Automatic task timer (5s execution). * Swoole_timer_tick resolution of second-level timing; * To adjust, note the

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

Function of Shell programming

Functions: functionProgram Programming: Code ReuseModular programmingStructured programmingThe code of an independent function as a whole, and a name for it; a named code snippet, which is a function;Note: The code snippet that defines the function

The Shell in Linux

What the shell means: First, the Shell's English meaning is "shell"; It is relative to the kernel, because it is proposed to be based on the core of a user-oriented form of expression, such as we see a ball, see its shell, rather than nuclear.

shell-Process State variables

$? is used to determine whether the previous command has performed successfully.If the return is 0, the execution succeeds and fails if it returns to a different value.650) this.width=650; "Src="

Use the most frequently occurring IP in the shell script statistics file

For example, there are the following files Test.txt1 134.102.173.432 134.102.173.433 134.102.171.424 134.102.170.9To count the most frequently occurring IPs, you can take advantage of the following shell script:Cat Test.txt | awk ' {print $} ' |

Shell Programming (i)

One of the basic features of bash:Command history: The shell process saves commands that were previously executed by the user in its session;~]# historyThe ability to customize the history can be achieved through environment variables:The number of

Linux Shell Basics

I. File systems and Securitychmod commandThe chmod command has two modes, one is the symbol mode, executes the user with the Ugo, executes the permission with the RWX, the other is the absolute mode, uses the different value of the octal different

Shell processing input

1, when the script is run to specify parameters, directly behind the script name to follow the parameters to be added, in the process of running, "$" represents the program name, "$" represents the first parameter, the second parameter, the Nineth,

Java invoke shell script

In the actual project, Java sometimes needs to call C write out of things, in addition to JNI, I think a better way is Java call the shell. First write the C to make the executable file, and then write a shell script to execute the executable file,

Total Pages: 541 1 .... 533 534 535 536 537 .... 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.