The most crude version
Shell Code
Find. -name "*.java" |xargs wc-l|grep "Total" |awk ' {print $} ' find
.-name "*.java" |xargs cat|wc-l #Output: 37634
The above two sentences are the same, but the second one is to use cat to merge the
Command lineWhen users log on to the Linux system, they can see a shell prompt that identifies the start of the command line. The user can enter any commands and parameters after the prompt. For example: $ date 211 01:34:58 CST 1999 $
Here document is one of the ways in which you define block variables in bash.
The form of the definition is:
Command
...
...
...
HereIts role can be used to define a variable, the command and the content between here using the way to input to the
Shell string Comparisons
The method of comparison of integers in a Shell and the method of comparing strings, such as equals, not equal to, greater than, greater than or equal, less than, etc.
Binary comparison operator, comparing variables or
There are two ways you can execute a shell script under Linux:
Note: This article is reproduced from: How to execute shell script under Linux
1, with the shell program execution script: According to your shell script type, choose Shell Program,
Original address: http://blog.zol.com.cn/2322/article_2321763.html
$ () and ' (anti-quote)
In the bash shell, $ () and "(anti-quote) are used for command substitution.$ echo the last Sunday was $ (date-d "last Sunday" +%y-%m-%d)Get the date of the
The Linux shell can be user-defined functions and can be called casually in shell scripts.The functions in the shell are defined in the following format:[Function] funname [()]{Action[Return int;]}Description1, can be with function fun () definition,
1, Shell 1.1, IntroductionThe shell is meant to mean "shell", a "shell" program that surrounds the Linux kernel, and all the tasks that the user completes on the operating system are implemented through the interaction of the shell with the Linux
Difference:1, two files are set environment variable file,/etc/profile is a permanent environment variable, is a global variable,/etc/profile.d/set all users to take effect, is also a permanent variable, is a global
Requirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program, subroutine, configuration file, mail engine,
Objective After installing CDH and Coudera Manager offline, all of your own apps are installed through Coudera Manager, including HDFs, hive, yarn, Spark, hbase, and so on, and the process is a twist, so don't complain and go straight to the
This is the code development style, in fact, is a function name, equivalent to the underscore division, but read into the package name after the meaning of different. This is defined in accordance with Google's shell development
Original 52779364The problem with script development is that the string splitting operation in the original Java (substring indexof, etc.) does not know what to do (e.g./a/b/c/d.txt I want to know the name of the file)Query information that the
The shell itself is a program written in C, which is a bridge for users to use Linux. The shell is both a command language and a programming language. As a command language, it interprets and executes user-entered commands interactively, and as a
1,$$: Displays the current process ID number[Email protected]:~/linux/shell/how_to_use_var$CatShow_pid.SH #!/bin/BashEcho $$Sleep the[email protected]:~/linux/shell/how_to_use_var$ bash show_pid.SH&[1]9401[email
Export Feature Description: Sets or displays environment variables.syntax:export [-fnp][variable name]=[variable setting value]Additional Note: when executing a program in the shell, the shell provides a set of environment variables. Export can add,
Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help information/ETC/PASSWD records the user's account/etc/shadow is an optional encrypted password file (view requires sudo
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