Linux --- tail command
Linux tail command-used to View File Content
The most basic options are cat, more, and less.1. If you only want to view the first five lines of the file, you can use the head command, for example:Head-5/etc/passwd2. If you want to view the last 10 lines of the file, you can use the tail command, such:Tail-2/etc/passwd or tail-N 2/etc/passwdTail-F/var/log/messagesParameter-F keeps tail reading the latest content, so that it can be monitored in real time and ended with Ctrl
install Python-mutagen find.-INAME "*. MP3"-execdir mid3iconv-e GBK {}/;Display Chinese characters in the consoleWhen using sudo apt-Get install zhcon, enter zhcon.
FileQuickly search for a fileWhereis filenameFind directory-name file nameView File TypesFile filenameDisplay the last six lines of XXX FileTail-N 6 XXXLet tail keep reading the latest contentTail-N 10-F/var/log/apache2/access. LogView the content between the fifth line (inclusive) and the second line (inclusive) in the file.Sed-n'5
you know how mr. Q did this?
Inputthere are several test cases.
For each test case:
The first line contains two integers, N and M, meaning that the wall is divided into N segments and there are m operations (0
Then M lines follow, each representing an operation. There are two kinds of operations, as described below:
1) P A B C
A, B and C are integers. this operation means that Mayor x painted all segments from segment A to segment B with color C (0
2) Q A B
A and B are integers. this is a
two integers, N and M, meaning that the wall is divided into N segments and there are m operations (0
Then M lines follow, each representing an operation. There are two kinds of operations, as described below:
1) P A B C
A, B and C are integers. this operation means that Mayor x painted all segments from segment A to segment B with color C (0
2) Q A B
A and B are integers. this is a query operation. it means that someone asked that how many kinds of colors were there from segment A to segmen
wildcard character does not affect the weight.
3.. a. B a {color: green} // 0.0.2.1 Description: two classes and one label
4. # hid {color: black;} // 0.1.0.0 Note: there is only one ID
Next article: "previous lives" of the HTML 5 History API"
CSS attribute setting priority
1. Multiple selectors may select the same element, with three rules, reducing the importance from top to bottom:! Important user Style! Important author StyleAuthor StyleUser StyleStyle defined by the browser2.CSS norms de
"));3637ParaR. add (new Chunk (", second chunk "));3839ParaR. setAlignment (Element. ALIGN_LEFT); // left alignment4041ParaR. setLeading (30f); // you can specify the distance from the preceding paragraph.4243Document. add (paraR );4445Document. close (); // close the document4647}
ListA series of Paragraph Components
Code:
01Public static void main (String [] args) throws FileNotFoundException,02DocumentException {03Document document = new Document (); // create a Document04Response writer. ge
How does linux display certain lines of a file (several lines in the middle) and several lines of linux?[1] 3,000th rows are displayed starting from 1000 rows. Display 3000 ~ 3999 rowsCat filename | tail-n + 3000 | head-n 1000[2] display rows 1000 to 3000Cat filename | head-n 3000 | tail-n plus 1000* Pay attention to the order of the two methodsDecomposition:Tail-n 1000: displays the last 1000 rowsTail-n + 1000: The value ranges from 1000 rows to 1000 rows.Head-n 1000: displays the first 1000 ro
;Int main (){Int a [5];Int * p;P = a; // p is the address of a [0], because a points to the first address of a, that is, to a [0],* P = 10; // a [0] = 10P ++;* P = 20; // a [1] = 20P = a [2];* P = 30; // a [2] = 30;P = a + 3;* P = 40; // a [3] = 40P =;* (P + 4) = 50; // a [4] = 50For (int n = 0; n {Cout }Cout }
Output:10, 20, 30, 40, 50,
Brackets [] indicate the index of the array element to be referenced ). Brackets []
third part. the cut command can extract text columns from a text file or text stream. -D: followed by separator characters. Used with-f;-f: Splits a piece of information into segments based on the-d separator, and uses-f to get the meaning of the segments; cat/etc/passwd | cut-d': '-f 1, 3 Use: to split the passwd file and retrieve the first and third columns of the passwd file cat/etc/passwd | cut-d ': '-f 1-3 Use: Split the passwd file and retrieve the first column of the passwd file to the t
The tail command is used to view the file content. Its common parameters are as follows:
1.-F option: dynamically view the content appended to the file, which is generally used to monitor log files.
# Tail-F/var/log/syslog
2.-N option: specify the number of rows at the end of the display.
# Tail-N 5/etc/passwd # tail-5/etc/passwd
Both of the preceding commands can be used.
Other commands used to view file content, such:
1. view the specified number of rows before the file
# Hea
When you need to view the header or tail of a text file, the head command and tail command can easily complete this operation. The head command is used to view the beginning of a text file, while the tail command is used to display the last few lines of the text file. The two commands are as follows:Head example.txt displays the top 10 lines of example.txt;Head-N 20 example.txt displays the first 20 rows of content in the file example.txt;Tail example.txt displays the last 10 lines of example.tx
Linux tail command-used to View File Content
The most basic options are cat, more, and less.
1. If you only want to view the first five lines of the file, you can use the head command, for example:
Head-5/etc/passwd
2. If you want to view the last 10 lines of the file, you can use the tail command, such:
Tail-2/etc/passwd or tail-N 2/etc/passwd
Tail-F/var/log/messages
Parameter-F keeps tail reading the latest content, so that it can be monitored in real time and ended with Ctrl + C!
3. view the
Sed is the more commonly used text editing Class command in Linux, with the rule progressive outputIts more commonly used usage is as follows:sed [OPTION] {SCRIPT} FILENAMEMain [OPTION]:-N: No longer displays content in the default mode space-I: Modifying source files-E: Perform multiple operations at the same timeFor example: sed-e {script}-e {script} ...-F: Specifies that the script file handles the text contentExample: Sed-f scriptname FILENAME-R: Allow extended regular expressions (same as G
Directory:Basic operation of 1.sed, mode space, advanced operationWhat is one.1 sed?Streaming editor, the text content line-wise, you can copy, delete, modify the fileONE.2 sed formatSed-n '/^for/p '/etc/passwd lists the lines in the/etc/passwd file for the startSed-n ' 5,8p ' file Find file 5th row-N Mask Default output' 5p;8p ' shows 5th, 8th line' 4,+10p ' line 4th, and the following 10 linesHow many lines of ' $= ' statistical files can be judged
Primarily SED, head, and tail commands if the text uses \ n such symbols, the cat command treats it as a newline character, resulting in an error of $ sed-n "10p" move.sh # showing line 10th$ sed-n "7,10p" move.sh # Show lines 7th through 10th$ Cat Recorde | Head-n 10|tail-n 1 # shows line 10th, first 10 rows, and then the last line in the 10 rows$ Cat Recorde | Tail-n +10 | Head-n 1 # shows the 10th row, first the 10th line and the next, and then the
Coin Sumsproblem 31In England the currency was made up of Pound,£, and Pence, p, and there were eight coins in general circulation:
1p, 2p, 5p, 10p, 20p, 50p,£1 (100p) and£2 (200p).
It's possible to make£2 in the following-to-be:
1x£1 + 1x50p + 2x20p + 1x5p + 1x2p + 3x1p
How many different ways can£2 is made using any number of coins?Go to the "thread for Problem" in the forum.Download Overview for Problem 31.The first thing I
Below is the output information of my wlan0 NIC, you can use Ifconfig or Ifconfig | Sed-n '/wlan0/,10p ' gets the format of the displayed informationwlan0 Link encap:ethernet hwaddr xx:xx:xx:xx:xx:xx inet addr:172.29.164.251 bcast:172.29.167.255 mask:255.255.248.0 INET6 addr:2001:da8:c803:4a57:e190:606f:3155:9369/64 Scope:global INET6 addr:fe80::6e71:d9ff:fe0b:27f6/64 scope:link INET6 addr:2001:da8:c803:4a57:6e71:d9ff:fe0b:27f6
potential, so clear the data, the space has been empty. October 2006, I bought a 300M space for my corn owner 100u.com, tied Www.aituzhe.com and asked someone to update 10P articles for me every day, and IP grew because I didn't do pornography, One months after the ip600/days, an IP is about 3 PV, is said to have a good trip, suddenly I use the space for the program I use does not support, and even I changed the PE put up can not be normal operatio
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.