File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link
Video linkPotatoes:Station B:Directory of this chapter:1. Bash Shell1.1 What is a shell? (We communicate with the kernel core through the shell, enabling kernel to manipulate the hardware)1.2 System shell and/etc/shells function (Cat/etc/shells, you
Pipe: grep foo/path/to/file | Grep-n-K 3 | MoreThe actual process is the opposite of what we intuitively believe, and it is best understood through the actual process. The first thing to run is more, and its input is connected to a pipeline. Then it
As a participant in a large open source community, or rather as a member of the Fedora project, I have the opportunity to meet with many people and discuss various interesting technical topics.My favorite topic is "command line" or shell, because
In Linux, if the file name is enclosed in parentheses, the parentheses should be processed first, preceded by "\" before "(" and ")". Bracket_handle gives the processing method:Sub Bracket_handle {My ($tmp _name) = @_;$tmp _name =~ s/\ (/\\\ (/g; # (
Regular expressionsJob One: organize regular expression BlogsRegular expressionsA regular expression is the rule of a string of characters in a class word.GrepThe grep command is useful in situations where a pattern-based search is performed on the
Task one goal: Automatic deployment, initial configuration, and start Nginx reverse proxy serviceSplit the task-the Automatic Deployment section is the first to download the installation NginxFirst, create a very NB-domineering catalogue and a
Loop of shell scripts: repeating commands1.for CycleGrammar:For variable name in variable Value listDoCommandDoneFor based on the contents of the variable Value list, executes the command repeatedly until all the contents of the Variable Value
Shell Basics (i)* represents 0 or more arbitrary characters? represents an arbitrary character# Comment symbol, comment description meaning, that is, the content behind the # Linux ignored, or in the shell script to explain the symbol, explain the
Job One: organize regular expression BlogsHave finished finishing.Job Two: grep jobs (regular expressions and character processing)Target file/etc/passwd, using the grep command or Egrep1. All rows containing root are displayed:[[email protected] ~]#
Collect a simple shell learning document:Link:http://c.biancheng.net/cpp/view/6994.htmlThe shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a
The next best thing to do on a virtual machine: Docker is the most convenient1. Installing RpmbuildYum-y Install Rpmbuild rpmdevtools-y2. Generate a package pathWith Rpmdev-setuptree, a Rpmbuild folder is automatically generated in the user's home
Encountered a remember a1, omit sudoUsing the Su-i command after landing with the primary user will log in as root in the shell, then the command will not need to add sudo and password. Another user has tried, Su does not have the-i option. Online
1.Linux default shell is bash,unix default shell is shBash is fully compatible with SH2. Define variables:When defining a variable, the variable name does not have a dollar sign ($), and a variable is used before the variable name plus $There can be
Delete
${varname#strmatch}//Match the Strmatch from scratch in varname and then remove the position from the beginning to the first match
${varname# #strMatch}//Match the Strmatch from scratch in varname and then delete the position
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