Linux Shell Learning Notes third Day _ other

Day Three: Conditional selection Outline application Example Analysis Condition test if...else...fi Case...in...esac Implement function Menu : After executing the script Press 1 to display the current time Press 2 to show CPU load

Linux Shell Learning notes the next day _ other

Variable Get the native host name #hostname Get the system version number #uname-R Get CPU Type Get the CPU working frequency Cat/proc/cpuinfo Get Memory

Linux compression and Backup commands Daquan _linux shell

bz2

First, compression and decompression 1, compress [-RCV] file or directory uncompress files. Z -R: Can be compressed together with the files in the directory -C: Export compressed data to standard output (output to screen) -V: Can display the

One day a shell command Linux text content Operation series-cut command detailed _linux Shell

Description Cut press the column to split the file and you can specify the delimiters for each column. In cut terms, each column is a field, sometimes the first column, which may be described as the first field. Actual combat: Suppose there is a

SED beginner practical Description _linux Shell

For example, after more than one system, application installation, we often need to modify a lot of configuration files, with the VI editor means time-consuming, repetitive work, and SED can release us from the heavy duplication of work. How SED is

CPU load Monitoring script code _linux Shell

Copy Code code as follows: #!/bin/bash Load= ' uptime ' shijian= ' Date +%y-%m-%d-%t ' File=cpustatus.txt Touch $file All= ' Cat $file |wc-l ' printf "$load $shijian \ n" >> $file if [[$all > 60]]; ThenStarttime= ' cat

Linux command line and shell script Cheng Richard blum_linux Shell

First script file Copy Code code as follows: #!/bin/bash echo "This are my I-A-bash code!" Exit 0 redirect Symbols and mathematical calculations Copy Code code as follows: #!/bin/bash Echo-n "The time and

Except a few pieces of code to login automatically share _linux shell

ssh

Copy Code code as follows: #!/usr/bin/expect-f Set Timeout 30 Set Host "192.168.1.198" Spawn ssh $host Expect_before "No"? { Send "yes\r"} Sleep 1 Expect "Password:" Send "123456\r" Expect "*#" Send "echo my name is

A collection of 55 Linux system management commonly used in some shell commands _linux shell

1. Show the top 10 processes consuming memory/cpu Copy Code code as follows: PS aux | Sort-nk +4 | Tail PS aux | Sort-nk +3 | Tail 2. View process Arrange by memory from large to small Copy Code code as follows:

Linux View all users and view user groups (modify user groups) _linux shell

1. View all users in Linux (1) in the terminal. In fact, only need to view the/etc/passwd file on the line.(2) Look at the third parameter: More than 500, is built behind the user. Others are users of the system. or use cat/etc/passwd |cut-f 1-d:

Shell script implements recursive delete empty folder _linux Shell

Sometimes we need to delete the empty folder recursively, search the internet for a while, did not find a better shell script, so we wrote a Script Copy Code code as follows: #!/bin/bash # Author: Ten years later, Lou's brother #

GETCWD Cannot access parent directories error resolution _linux Shell

Copy Code code as follows: [Root@web-server php]#/etc/init.d/httpd Restart Shell-init:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or directory This error indicates that the GETCWD command could

Nginx multi-server log split script sharing _linux Shell

1, configure multiple server logs as long as the $website variable is incremented and separated by a space.2, looping to create the log directory3, after the split with XZ compression, of course, can not be installed with Gzip bzip2 and so on.4,

Some of the Linux shell uses tips to collect _linux shell

Check to see if the remote port is open to bash: Copy Code code as follows: echo >/dev/tcp/8.8.8.8/53 && echo "Open" To get a process into the background: Copy Code code as follows: Ctrl + Z To move a

Sqlmap combined with Meterpreter to realize injected infiltration return to shell

Build a Php+mysql platform, the range for DVWA, set the SQL injection range level of low (easy to test use).Enter 1 in the Submit box, grab the package with Burp, copy the package data to the Cookies.txt document, and drag to the Kali

Git-shell How to restrict user SSH login instances

Although Git is a distributed version management system, for team project development, it is common to create a git server on a separate server. Similar to Svn,git server, there are several ways of configuring it. For more information, refer to

echo of Shell Base command

the function of the echo command is to display a piece of text on the display, which generally acts as a hint. the general format of the command is: Echo [-n] string where option n means that the output text is not wrapped, the string can be quoted,

Shell Experience Three

Testing and comparison of shell scriptsTest command: Checks the file type and compares the value (depending on the execution result of the expression (true or false), returns an exit status. )NAMETest-check file types and compare

Break and continue in the shell

I see in the study not only has the break and the continue existence, as well as break-n and the continue-n existence so what difference does it have.You can then write the test set code:For i in a B c DDoEcho-n $iFor j in ' seq 10 'Doif test $j-eq 5

Linux mysql5.7 database full backup and incremental backup shell instance

I have previously written a script similar to mysql full and incremental backup, but it is too simple. Last night, I wrote an instance for mysql5.7 for the company's online server, which is relatively more optimized.Note: This script is only

Total Pages: 541 1 .... 197 198 199 200 201 .... 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.