LS-LH //view file sizeLS-LH filename //View the actual size of a filedu-h //Viewing the size of a file as a diskdu-h filename //View the size of a fileThat LS looks at the actual size of the file, Du is looking at the size of the disk blockDu
Creation and execution of a script1. Create file *.sh, file suffix sh2. Editing scriptsThe first line must be: #!/bin/bash #指定解释脚本的shell3. Empoweringchmod u+x a.sh4. Implementation./a.shVariables in the two shell scripts1. Definition and deletion of
Batch modify file suffixThe first type:#!/bin/bashfor fn in *.$1domv $fn ${fn%$1}$2doneThe second type:Find. -name "*.txt" | Awk-f ' [./]+ ' {print $} ' | Xargs-i-T mv {}.txt {}.shGREP User TipsThe file is as follows:# cat Test.txt This was a test
The most recent thing about egg aches is that you need to get root in the shell script, so you need to enter a password when the shell script is running.Lazy I certainly want to let the shell in the execution process can automatically enter the
Implementation requirements: Create user student1 to Student50, specify Group as student group! And each user needs to set a different password! The script is implemented as follows:#!/bin/bashfor i in ' seq 1 "do useradd-g student student$i; echo
Variable settings:~/dos # dfs=2 Variable use:You can read it using EHCO, but you need to precede the variable name with $, or the ${variable}.~/dos # echo $dfs 2 ~/dos # echo ${dfs}
[[email protected] ~]# mkdir shell[[email protected] ~]# cd shell/[[ email protected] shell]# vim first.sh#!/bin/bash must be # #the first test shell script. Description # #written by guozhen.mkdir 123
For tired print and Echo, try a little bit of fresh effort.1. Using the shell's execution optionsThe common execution directives for SH and bash are:-N,-X,-C,-V.which-N is a shorthand for noexec, which is to do only the syntax checking of the script
SSH Main parameter description-L Specify Login user-P Set Port number-F run in the background, and recommended with the-n parameter-n redirects standard input to/dev/null to prevent reading standard input-N Do not execute remote command, only port
When you create a child process with fork (), you execute the same program as the parent process (but it is possible to execute a different code branch), and the child process often calls one of the exec functions to execute another program.Process
Some knowledge of variables in the shell:Variable:1. By default, all variables are considered to be stored as strings.2. Variable case sensitivity3. Add $ to the variable name before accessing the content4. No declaration required5. The $ extension
The structural characteristics of the all-back text are as follows:Assuming that the number of characters is even, it is structurally represented as a sequence of characters with the same character but with the opposite sequence of
* Wildcard character (* for 0 or more arbitrary characters)[[email protected] ~]# ls *.txtA.txt1. txt:2. txt:? Represents only one arbitrary character[email protected] ~]# Touch Testa[[email protected] ~]# touch Testb.txt[[email protected] ~]# ls-d
1. Check if the remote port is open for bash:
echo >/dev/tcp/8.8.8.8/53 && echo "open"
2. Turn the process into the background:
Ctrl + z
3. Transfer the process to the foreground:
fg
4. Generates a random
There's nothing going on today. A lot of operations in the shell about efficiency issuesNo, nothing else, no use.It's just something to do.At first, that's the arithmetic.What I recommend here is to use the $ (()) method for simple
This note is for the early ximo of the shelling Basic video tutorial, organized notes. the tools used in this note:http://download.csdn.net/detail/obuyiseng/9466056Exe32pack1.ESP Law1, the program loaded into the OD, found that there is a large
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