Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Thank you very much, if I'm in a directory instead of getting a list.txt and all files which is in the list.txt is in the current dir, what would be the right command to do the job? Commented Jan 22, 2019 at 0:18
  • That's not what you asked for ;) If you need to copy the files in the current directory you would do something similar with cp Commented Jan 22, 2019 at 0:21
  • 1
    @user1794469 That is what he asked for. The question states that he is trying to find and copy files. There's no need to put the filenames into a file and then grep for them. Commented Jan 22, 2019 at 0:25
  • @NasirRiley he edited the question. Commented Jan 22, 2019 at 0:27
  • 1
    @user1794469 And it still states that he is looking to copy files. The only way for grep to apply would be the put the names into a text file before using grep which isn't necessary when find is already available. Commented Jan 22, 2019 at 0:30