Is there a command that will delete the first 50 lines in a file? I know I can display the first 50 lines with "head -50 somefile.txt", but I need to delete the first 50 lines.
Originally posted by kenny Is there a command that will delete the first 50 lines in a file? I know I can display the first 50 lines with "head -50 somefile.txt", but I need to delete the first 50 lines.
tail +51 = it will print the 51'st line to the last line
> somefile.txt.tmp = redirect the output to a temp file
mv somefile.txt.tmp somefile.txt = move the temp file over the original file (you can skip that part if it's not necessary)
tail +51 = it will print the 51'st line to the last line
> somefile.txt.tmp = redirect the output to a temp file
mv somefile.txt.tmp somefile.txt = move the temp file over the original file (you can skip that part if it's not necessary)
I learned a few advanced commands from you, you must be lethal with a shell
Comment