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
  • 84,225
  • 14
  • 89
  • 153
gr68
  • 420
  • 1
  • 10
  • 25

1 Answers1

2

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

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