Using shell commands under Linux often uses shell output redirection like this:
1>/dev/null 2>&1
At the end of the shell command, we can redirect the output through the > symbol.
1. Standard input stdin file descriptor is 0, standard output
Original: http://blog.csdn.net/iamlaosong/article/details/54728393
Recently, to compile a shell script to process the data, you need to detect the existence of the data file, the file name contains the date, so you need to generate the date of the
Configure the ADB command on your MacWhen you use the ADB command in Mac OS, you should configure the variables as follows:First, the terminal input CD ~Second, enter touch. Bash_profile returnTouch: If not, create a file, if any, update the file
If condition test common syntax
Test
[]
[[]]
())
Test command AND [] testing operator
Test
[]
(these two syntaxes are equivalent)
test operator
full Spell
1. Basic knowledge Preparation 1.1. Linux background processUNIX is a multitasking system that allows multiple users to run several programs at the same time. The Shell's metacharacters & provides a way to run programs in the background that do not
Learn the first script from the shell, thanks to cloud Li Qiangqiang Teacher's shell programming tutorial
To create a shell script file:Touch menu.shTouch index.shTouch welcome.sh
To give the script file permission to execute:chmod a+x
This article is sponsored by Ilanniweb, starting in Slime Line the worldWant to get more articles, you can follow my ilanniwebThe company's business is to use Tomcat as a Web container, in order to more effectively utilize server performance, we
assignments and operations in the shell are string-handling by default, and here are a few special ways to do mathematical operations in the shell. In the future when you can see, hehe1. Examples of error methodsAVar=1+1Echo $varThe result of the
Shell: Can batch processing, automation to complete a series of maintenance tasks, greatly reduce the burden of administrators! The shell is a special application that acts as a "command interpreter" between the operating system kernel and the user.
Cat: View the contents of a file, connect a file, create one or more files, and redirect output to a terminal or file usage: cat [options] [file]1. $ Cat Hello.txtdisplaying content in a hello.txt text file2. $ cat-n File-N option to display the
Start Linx Shell's first article todayToday describes how PWD and CDs are used.The pwd means "Print working Directory", which displays the current location.PWD also has other available parameters-L (uppercase),-p (uppercase)-L is the same as the PWD
6.shell function6.1. Defining functionsBrief introduction:The shell allows a set of command sets or statements to form an available block that becomes a shell functionDefining the format of a functionMethod OneFunction name (){Command 1......}Method
Jar Package:http://www.ganymed.ethz.ch/ssh2/The advantage of this source is not dependent on a lot of other packages, copy come clean. Specific code implementation can be seen below, or refer to the official documentation, in the download of the
Recently, in the post-maintenance of a system. This is a kind of system, we take the method is, in our local area network server, there is a user server and a touch of the same database, the program is also a touch. After this modification, we copy
File Transfer
The biggest problem with the CMD shell obtained by the overflow vulnerability is how to upload files. Due to the prevalence of worms, ports 139 or 445 required to connect to IPC $ are blocked by routes. In addition, the WINXP system
The first and last days of this month:
Echo 'date -- Date "$1" + "% Y-% m-01 "'
Year = 'date-d "$1" + "% Y "'Month = 'date-d "$1" + "% m "'Last_day = 'cal $ month $ year | xargs | awk '{print $ NF }''
Echo $ year-$ month-$ last_day
Calculate the
Through the previous study, we learned what shell is and its classification and functions. Now we will learn how shell executes the program, that is, the first function of shell. Here we first understand how shell executes the program, learn the
Linux Command Line and shell script Programming
This time, I read the Linux Command Line and shell script programming book for 3rd Times. In general, this book is quite good. It is suitable for beginners. I also learned about shell programming from
Here we will first introduce the basic syntax of shell, including the beginning, comment, variables, and environment variables, however, laying a good foundation is a prerequisite for easy learning in the future.
1. Linux script compiling Basics
◆ 1.
The shell script deletes the folder N days ago. The date commands on linux and mac are different,
Background:Every day you build things and put them in different folders by date. For example, today's construction is put in, tomorrow's will be put
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