In Linux, you can use commands to directly Delete the last line in the file.
Source: Internet
Author: User
In Linux, you can directly Delete the last line in the file-Linux general technology-Linux programming and kernel information. The following is a detailed description. What is Sed (Stream EDitor ):
Sed is a non-interactive stream editor on UNIX systems ). When Sed reads the file to be edited, It edits the file according to the editing command.
Sed-I '$ d' file
Like other UNIX commands, Sed is also read from the file to be edited by standard input. After Sed is processed, the result is sent by standard output. Because Sed reads text line by line and edits it based on commands, it can be viewed as the text in the file line by line through the Sed editor.
Sed can automatically edit files based on the commands you run. Therefore, Sed becomes an important tool for file editing in pipe line.
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