How to delete a particular line from a file?

On Linux, what is the easiest way to delete the firstĀ  6 characters of each line in a linux file?

  • Answer:

    I think... sed 's/^.\{6\}//g' inputfile > outputfile

Mark Harrison at Quora Visit the source

Was this solution helpful to you?

Other answers

colrm 1 6 < InputFile > OutputFile

Sharad Nandanwar

Presuming a file named yourFile.txt, you can use the program cut: cut -c7- yourFile.txt or if you want to save the output in a new file named trimmedFile.txt: cut -c7- yourFile.txt > trimmedFile.txt http://linux.die.net/man/1/cut

Joe Boyle

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.