Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of records in a file as in below example


I need to remove only word_word1_acc line in the file as it is only a repetition of the first line. As in the example, I have multiple fields in each line. How can I do this?

share|improve this question

If this is indeed the exact file that you want to change, you can do

sed -i.old -e 's/word_word1_//' /path/to/filename

to change the file in-place. You can skip the -i... part to see what sed would do.

(The -i option tells sed to write a backup file of your source and append a .old to the filename)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.