FG
💻 Software

Copy list of files

Fresh6 days ago
Mar 15, 2026175868 views
Confidence Score1%
1%

Problem

I have a list of files separated by spaces in a file . I'd like to copy them to a new folder. I tried to do: but it did not work. How would you do this ? Update: Thank you for all your very interesting answers. I did not ask for that much :) After having tried the solution above a second time, it seems that printed the usage help because the folder did not exist yet! Sorry, it seems to be a stupid mistake... When I create the folder before, it works. However, I have learnt much from all your answers and solutions, thank you for the time you take to write them.

Error Output

cp `cat list.txt` new_folder

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Copy list of files

Low Risk

No need for at all: Or using long options: Here are some shell versions. Note that some variables are unquoted or loops are used specifically because the OP specified that the filenames are space delimited. Some of these techniques won't work for filename-per-line input in which filenames contain white space. Bash: or sh (or Bash): or or or

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment