A file test is a test of whether a file or directory existsTest file format [operator directory or file] Note that there is a space between the opening parenthesis and the operator, and there is a space between the file or directory and the
Put the app's log with the date name into the archive-specific directory (the log shaving is logging)Find $APPHOME/logs | Grep-v "Info.log\|debug.log\|error.log" | Xargs-i tar-cvzf-c/opt/logs/$DATE. tar.gz {}Date: date= ' Date +%y%m%d%h%m%s 'Find.
number of logged-in users: who | Wc-l
See which users are logged on to the system : who
Create a new file /bin/ct11, enter a command in the file,chmod Set the Execute permission for the file
# cat >/bin/ct11W.H.O. | Wc-lPress Ctrl+d# Cd/
A Linux shell script Shell: command-line interpreter(1) SH(2) CSH(3) Ksh(4) Bash Shell script: A collection of commands that accomplish a specific thing Two run a shell script file 1. Add executable permissions, and then run the./shell script file2.
1, the database is fully prepared to the hard disk[[Email protected] scripts]$ cat rman_backup.sh source /home/oracle/.bash_ profile rman target / log=/home/oracle/backup/backupall_rman.log2. Incremental backup ScriptLevel 0
1. Create a folder script:#!/bin/bash#mkdirmkdir/home/img/pages/savedpictures/mission/xinlangweibo/$12. Query whether the folder exists:#!/bin/bash#find dirfolder= "/home/img/pages/savedpictures/mission/xinlangweibo/$1/" if [!-D "$folder"]; Then #no
Enterprise Practice Question 16:Enterprise Case: Write Network Service standalone process mode rsync system startup scriptFor example:/etc/init.d/rsyncd{start|stop|restart}.Requirements:1. To use the System function library technique.2. To use a
Shell after class summary
High wavesArchive: Learning NotesDecember 4, 2017 13:31:08
Shortcut keys:Ctrl + 1 title 1Ctrl + 2 title 2Ctrl + 3 title 3Ctrl + 4 ExampleCtrl + 5 Program CodeCtrl + 6 Body
Format
Shell: The command interpreter executes the corresponding command according to the command entered.See which shells are under the current system:Cat/etc/shellsView the shell that is currently in use by the systemEcho $SHELLCommon shell/bin/sh "has
Pipe characters and variablesOne, the pipe character and the job command1.txt |wc–l; Cat 1.txt|greap ' AAA 'The command for the pipe character is to give the result of the previous output to the following command2.ctrl z pause a task3.jobs viewing
nlShow file line numbernl myscriptPrintfformatting text%[-+]m.nx-The starting position from the beginning of the linem represents the width of the field and N indicates the maximum width of the fieldS: String.C: Character.D: number.X:1 6 binary
One, Shell scriptScript: Can execute the file, after running can implement some function (command stack, non-interactive)Standardize the general composition of shell scripts#! Environmental Statement (Sha-bang)# comment TextExecutable codeSecond,
Pipe character and job control; indicates that the previous command executes the next command in sequence[email protected] ~]# cat 1.txt |wc-l; Cat 1.txt |grep ' aaa '2AAAAAAAAAAAaqweaaaaaaaaa&&: The previous command is correct to execute the
Shell IntroductionThe shell is a command interpreter that provides interaction between the user and the machine, supports specific grammars, such as logical judgments, loops, and each user can have their own specific shellCentOS7 default shell is
Introduction to ArraysBash provides only one-dimensional arrays, and does not qualify the size of the array. Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the array to take advantage
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