In Linux, you can use the sed command to delete the first few lines of a file. This command can process and edit text files according to the instructions of the script. It can be used with regular expressions to achieve the effect of deleting the first few lines of the file. Syntax It is "sed -i '1, number of first few lines d' file name".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
sed -i '1,nd' 文件名 这个是删除第一行到第n行
sed is a stream editor. It is a very good tool for text processing. It can be used perfectly with regular expressions and has extraordinary functions. . During processing, the currently processed line is stored in a temporary buffer, called "pattern space", and then the sed command is used to process the contents of the buffer. After the processing is completed, the contents of the buffer are sent to the screen. Then process the next line, and repeat until the end of the file. The file contents are not changed unless you use redirection to store the output.
Sed is mainly used to automatically edit one or more files. It can perform specific tasks such as replacing, deleting, adding, and selecting data lines, simplifying repeated operations on files, writing conversion programs, etc.
Syntax
sed [-hnV][-e<script>][-f<script文件>][文本文件]
Parameter description:
-e