0

I have a flat file data.txt in Linux/Centos server which contains a list of files e.g.

# cat data.txt
/home/user/data/1
/home/user/data/2
/home/user/data/3
/home/user/data/4
/home/user/data/5
/home/user/data/6

how can I remove from data.txt all rows before

/home/user/data/4

to receive this result

# cat data.txt
/home/user/data/4
/home/user/data/5
/home/user/data/6
Cyrus
  • 77,979
  • 13
  • 71
  • 125
gr68
  • 612
  • 1
  • 6
  • 23

1 Answers1

2

sed -ne '/^\/home\/user\/data\/4$/,//p'

Martin Väth
  • 226
  • 1
  • 2
  • 3