You can use the tail command in Bash to print all but the first 1000 lines from a file. Here's the command:
tail -n +1001 filename.txt
This will output all lines of the file filename.txt starting from line 1001 and onward, effectively skipping the first 1000 lines.
The -n option specifies the number of lines to display, and the +1001 argument tells tail to start printing from the 1001st line. If you want to save the output to a new file, you can use the output redirection operator > like this:
tail -n +1001 filename.txt > newfile.txt
This will save the output to a new file called newfile.txt in the current directory.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-04-03 22:49:54 +0000
Seen: 24 times
Last updated: Apr 07
Bash Script that checks if a Host is available or not?
How can I check the expiry of a SSL certificate in the Command Line?
How can I only get the Column with the Filename from a ls -all output with Awk?
What is the Difference of "source script.sh" and "./script.sh" in Bash?
How can I fix error: Security violation, ping RPC from uid 1001 in Slurm log?
I want to grep for "```*" in a File, in other Words: "```" followed by any Word
Sed: I want to remove a Word after all ``` in the given File
Bash: How can I move all files containing a certain pattern to a different directory?