Discover linux command line and shell scripting bible, include the articles, news, trends, analysis and practical advice about linux command line and shell scripting bible on alibabacloud.com
Question Description: How do you deal with command-line options such as Tail-n Access.log in a Linux shell?
In bash, command line arguments can be handled in three ways, each with its own scenario.
1, direct processing, in turn to the $1,$2,..., $n, respectively, hand-handled;
2,getopts to handle the case of a single c
standard error , in seconds, of how long a command takes to execute, the system time, and the time command.Usage: Time [-P] Command [Argument ...]The result of the time command consists of three rows: real, user, and Sys. We use real values here, and CPU time is divided into user and sys two blocks.
The real value represents the elapsed time from the beginning of the program to the end of the program execution, including the CPU.
The user value represents the program itself, and th
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 showing the current user's location-p Display the user's current physical location and PWD are the sameIn fact, you can use PWD directly.CD can simply think of directory switchingFor example, currently on the/root/desktop, you can switch directly to
It is customary to use the Linux command line to manage Linux systems, for example:
Copy Code code as follows:
$ date
211 01:34:58 CST 1999
$
When the user logs in, it actually goes into the shell, and it follows a certain syntax to interpret the commands that are entered and pass them to the sys
use external program files to run.(1) such as exit and CD are built-in commands$type exit$type CDSome commands have multiple implementations, such as PWD and Echo, which have both external and built-in commands#type-a EchoThe which only displays external command files.Type-a shows two implementations of each command.Tip: For multiple implementations of the command, the default execution is built-in, if you want to execute an external command can specify the corresponding file is good.Like what$
If you are an IT person accustomed to a Windows command prompt, you will feel overwhelmed when you first use the Linux command line. You are familiar with DOS commands that are basically non-existent in Linux. In front of you is a lot of orders to memorize.One alternative is to use a powerful Linux
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
the shell you are currently using. For example, even if you call a different shell in a terminal, the $SHELL remains unchanged.
The code is as follows:
$ echo $SHELL
/bin/shell
So, to find the current SHELL, you s
are currently using. For example, even if you call a different shell in a terminal, the $SHELL remains unchanged.
The code is as follows:
$ echo $SHELL/bin/shell
So, to find the current SHELL, you should use $$ or $ $, but not $SHELL
One way is to useCatand anti-quotePS: Anti-quotes play the role of command substitution in Linux. Command substitution refers to the ability of the shell to interpolate the standard output of a command anywhere on a command line.The input format is as follows:20151207[email protected]. com20151225155581558905678As followsThe internal field delimiter (Internal field Separator, IFS) is an important concept in
distinguish between different kinds of devices, while the secondary device number is used to differentiate multiple devices of the same type.The Linux kernel uses a virtual file system (SYSTEM,VFS) as an interface for interacting with each file system. This provides a standard interface for any type of file system communication within Linux. When each file system is mounted and used, the VFS will slow down
Learn Linux, starting with the commandThe graphical interface just makes simple things simpler graphical interface can quickly handle simple things, such as opening/closing a file Then, as transaction complexity increases, the graphical interface is cumbersome to manipulate For example, insert a picture in Word: Toolbar--insert--picture--Browse directory--OK This feature is not really complicated, but the whole process, click at least 4 times and t
= 0;i = 1; does {total + = $i; i++} while (total Gawk ' {total =0;-(i = 1;i Chapter 23rd using other shellsYou can try to learn to use zsh and support modularity.24th. Writing a simple script utilitySlightly25th. Create DATABASE, Web, and e-mail related scriptsThe side that writes the script to MySQL is available:MySQL mytest-u test Show tables;SELECT * FROM Employees where salary > 40000;Eofecho "This is a text message." | mail-s "Subject" [email protected]-b [email protected]-C [email protec
"Linux Command Line and shell script programming Daquan" sed advanced multi-line command sed Editor contains three commands that can be used to process multi-line text 1.N: Add the next line in the data stream to create multiple r
Create functions in Linux Command Line and shell script ProgrammingBASIC script function creation function 1. use the function keyword, followed by the function name [plain] function name {commands} 2. the function name is followed by an empty parentheses, indicating that a function is being defined [plain] name () {commands}. If the names of the two functions ar
Chapter 25th: Using E-mailLinuxE-mail in Linux, the E-mail process is generally divided into three functions: MailTransferAgent (MTA) mailDeliveryAgent (MDA (
Chapter 2: Use e-mail
Linux E-mail Basics
E-mail in Linux
In Linux, the E-mail process is generally divided into three functions:
Mail Transfer Agent (MTA)
Mai
This article is one of the book notes in Chapter 6 "learning the bash shell" 3rd edition "command-line options and typed varilables, but we will not limit this article.
In Linux commands, parameters such as [-Option] are often included. There may be 0 or more options in the command line. We learned the location paramet
", as4. It is also possible to add two commands together, adding the character "HEAD", "TAIL" to each line of Test.file, and the command: sed '/./{s/^/head/;s/$/tail/} ' test.fileIn fact, the above is OK, spend too much time yesterday, mainly because the file is processed by MySQL from the database extracted from the results of the guide, others gave me after I directly deal with, too brain remnants =-I have been a little doubt the result is wrong, th
Early knowledge of sed and gawk in Linux Command Line and shell script ProgrammingThe sed editor of the Text Processing editor can process data in a data stream based on commands that are input to the command line or stored in the Command text file. It reads a row each time, matches the data with the provided editor co
-N: Add line numbers to all lines
-B: Add line numbers to lines with text only
-S: Compress multiple blank rows into a single blank line
-T: Hide tabs
More commands
The more command implements the text content, but stops after each page of data is displayed
Command op
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.