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
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.
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;
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
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
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
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:
#!
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
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.
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
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
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
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
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
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
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
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
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.