0

Explaining is hard I want to start with example. Please see the Bold text.

I have very long list like the following list :

http://dl3/film/**Daylights.End**.3*******************
http://dl45/film/**The.Wild.Life**.720***************
http://dl45/film/**The.Wild.Life**.10***************
http://dl3.pw/film/T**he.Wild.Life**.2*******************
http://dl45/film/**Daylights.End**.2*******************

I want to find all Duplicate lines that included same strings after /film/, but I don’t want to search the line to the end, the search should look for duplicate strings just like 10 or 20 characters after /film/

  • The strings after /film/ are different.
  • The method should search a list with like 5 thousand line and find all duplicate line and maybe after founding delete, cut, copy or mark One or Two of them.

Thanks in advance

2
  • Here's a start: cat long-list |grep -Eo '/film/.{15}' |sort |uniq --repeated. If this isn't what you want, please explain in more detail.
    – bitinerant
    Apr 4 '20 at 10:32
  • Are the * significant, especially between T*he.Wi and **The.Wi ? Would terminating near *.number be reliable? Apr 4 '20 at 10:39
0

Try

sed -n 's/^/@/' > newfile

or

sed -ni 's/^/@/'

Both commands are inserting an @ at the beginning every libe of your last command.

-1

nice, command output for

cat long-list |grep -Eo '/film/.{15}' |sort |uniq --repeated

is a list that contain all duplicate names. now how can i mark all duplicate line with something like a @ in start line?

1
  • You copied my comment into an answer and presented it as your own. Also, don't put questions in the 'answer' section. Ask a new question.
    – bitinerant
    Apr 5 '20 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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