From the "Linnux program design," the second chapter, from one by one to knock out, the conclusion is that a few s did not come out effect
#。 /bin/sh and #. There's a difference,/bin/bash.
The first direct typing is the former, always output some-E,
This article refers to the example on the http://www.docin.com/p-56167731.html
1. Statistics of the number of rows of a file can be made with the following command:
Grep-c "" Xxx.txt
Or
Grep-n "" Xxx.txt | Wc-l
___________________________
Ps:
Use
The Until loop and the while loop mean exactly the opposite, while loops indicate that when the conditional expression is true, the loop is continued, and the conditional expression jumps out of the loop when it is false; The until loop indicates
on the shell:
0 indicates standard input, input data from the terminal, generally refers to the keyboard
1 indicates the standard output, the data displays to the terminal, generally refers to the screen
2 indicates standard error output, Error
For a host system, there will be some inaccessible users in the system, but they must also exist, what we call the inability to log on, is that this user can not use bash or other shell to login to the system, not that this account can not use other
Linux Common Commands
LS-F: Catalog will show/
[Root@milab ~]# ls-ifl
total dosage
69199780-rw-------. 1 root root 1496 June 8 2016 anaconda-ks.cfg
77471938 Dr Wxr-xr-x. 2 root 6 September 21:49 svntest/
74325841-rw-r--r--. 1 root root 7
Shell programming
All the code is to simple basic sentence assembly, according to their own will to write, and finally get the desired functional program.
1, the beginning: #. /bin/bash
#。 Is the program that tells the system to follow the
The first step: Download Tomcat 7.0.27 Click the Open link, this is a no-install compression package, decompression can be used.
The second step: Apply for dynamic domain name, you can go here to register a peanut shell account, registered well
1, there are two common ways to run a shell script:First give executable permission, then enter the directory where the file is located, enter:./name.sh;Run the interpreter and execute the script:/bin/sh name.sh, in which case there can be no #! in
Shell: 1, local variables: variables available only in the current shell, 2, Environment variables: variables available for the current Shell's child processes 3, Shell variables: some shell Set the special variables, such as: $ $, $ ... These
read:Brief introduction:The read command reads the value of a variable from the keyboard and is typically used in a shell script to interact with the user. The command can read the values of multiple variables at once, and the variables and input
1. TopicsWrite a script to determine whether the 80 port of the machine (assuming the service is httpd) is open, if it is open to do nothing, if the discovery port does not exist, then restart the httpd service, the concurrent mail notify yourself.
One, pipe and operation control1. Pipe character: | (The result of the previous command output to the following command)Count the number of files after the ls command: LS |wc-lList the number of files in the/etc/directory: find/etc/-type f |wc-l2.
One, Shell command application exercises1. Describe the purpose of the following documents①/etc/passwdpasswd is a password file that is used to manage the user's password. Ordinary users can usually only modify their own password
What is Shellshell?
Shell is a scripting languagecan use logical judgment, circular judgment and other statements;functions can be customized;A shell is a collection of system commands, such as a batch command of Windows;Shell script can
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