Copy some line in linux using command only

Closed
Report
-
Posts
40805
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
-
Hello,
can u tell me how to copy a particular line from a file to another file using command
thank u

1 reply

Posts
40805
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
17
Hi,
grep 'pattern' file1 > file2
sed -n '/pattern/p' file1 > file2
;-))