The Unix shell uses the Globstart option in Bash to use the tutorial

When you are using some commands, such as: LS, git, just met some requirements is to easily traverse all the directories and files, and then after the search, finally found a "magic" wildcard "* *" (two asterisks), after setting the bash globstar

Awk calls the shell and passes the variable to the shell's variable pass between awk and the shell

Invoking awk in a shell script is very natural and simple, and if you need to invoke the shell script/command, you need to use the system () function, which is written as System ("sh my.sh" $var) if you need to pass the variable to the called Shell.

Five classic examples of Linux shell scripting "novice Learning"

Example one: Drawing Special graphics #!/bin/bashMax_no=0Echo-n "Enter number between (5 to 9):"Read Max_noif! [$MAX _no-ge 5-a $MAX _no-le 9]; Thenecho "WTF ... I ask to enter number between 5 and 9, Try Again "Exit 1FiClearfor ((I=1; i=i;

Shell timed detection mysqld,nginx,httpd service script in CentOS

A few days ago found that the site is not open, prompted the database connection error, I log on to Linux found Mysqld services do not know when to stop. Luckily, I even found out.So I decided to write a shell script to automatically detect the

Two ways to use arrays in the UNIX sh (Bourne shell) script _linux Shell

SH is not as easy to define and use arrays as bash and ksh, but you can simulate arrays in other ways. Method 1 simulates an array by using the SET command and positional parameters # define array set ' word 1 ' word2 word3 # Output Array's

Deep understanding of shell output color and control _linux shell

Objective We all know that when you use the LS command to list file lists, different file types are displayed in different colors. So how do you implement this color-colored text output? The answer is not complicated, whether it's in the shell or

The Linux shell implementation asks for the maximum and minimum value of a multidimensional array _linux shell

My colleague sent a shell question to find the maximum and minimum values in a multidimensional array.such as file 99file:33 55 23 56 99234 234 545 6546 3411 43 534 33 7543 34 76 756 33343 890 77 667 55 One of my implementations: #!

Automated download and detection of FTP file backup shell script _linux Shell

Implementation code: #!/bin/bash #ftime0 =$ (ll/root/hbshell/down.txt | awk ' {print $} ') #ftime1 =$ (ll/root/hbshell/down.txt | awk ' {print $} ') touch/root/hbshell/down.txt while:do if [[/root/hbshell/down.txt-nt/root/hbshell/down_cp.txt]

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

From this beginning, it is the text content operation, which differs from the text operation. The grep command in a Linux system is a powerful text search tool that uses regular expressions to search for text and print matching rows. The grep full

Use Netcat (Swiss Army Knife) for file transfer _linux shell

NC (Netcat) is known as the "Swiss Army Knife" in the network tool, although the volume is small but powerful, NC the simplest function is the port scan, here I take note of it as a file transfer of magical use. First look at the help information.

Shell command line Operation HBase Database instance detailed _linux

Manipulating the HBase database in the shell command line Shell control Enter the shell command line interface, execute the hbase command, and attach the SHELL keyword: [Grid@hdnode3 ~]$ hbase shell hbase shell; enter¨help¨for list of

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

Shell time (date) related commands _linux shell

Date +%f date-d last-day +%y-%m-%d date-d yesterday +%y-%m-%d date-d next-day +%y-%m-%d date-d Tomorro W +%y-%m-%d date-d ' 2 days ago ' +%y-%m-%d date-d ' 2 weeks ago ' +%y-%m-%d date-d ' 2 months ago ' +%y-%m-%d date-d ' 2 years ago '

Unpack the RPM package with Linux commands and rpm command introduction _linux Shell

RPM is a red Hat (REDHAT) package management tool that implements features like Add/Remove Programs in Windows RPM-IVH install_rpm Tar xvf Informix-linux.tar Inux to extract the command Daquan . tarUnpack: Tar xvf Filename.tarPacking: Tar cvf

Shell traversal directory processing specific directory script code _linux shell

Requirements: Delete files, directory structure: ip/year/month, everyone has a copy of this directory now need to delete all files before 2012, 2012 after the deletion of a specific month.Originally wanted to use find, the results found that these

Linux shell script implements TCP/UPD protocol communication (redirect application) _linux Shell

A few days ago, there were some interesting examples of redirects and piping-related usage. Software communication based on TCP/UDP protocol is implemented through redirection. There is a special file in the Linux device: /dev/[tcp|upd]/host/port

Linux under SSH installation and SCP command using the detailed _linux shell

The Ubuntu default does not have SSH service installed, which can be done with the following command: Copy Code code as follows: yblin@yblin-desktop:~$ ssh localhost Ssh:connect to host localhost Port 22:connection refused

${in Shell}, # #和%% use example _linux shell

Today read a script file when there are some places do not understand, find an article to read some, feel good, keep down.Let's say we've defined a variable as: Copy Code code as follows: File=/dir1/dir2/dir3/my.file.txt You

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

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

Total Pages: 541 1 .... 117 118 119 120 121 .... 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.