Move a list of files(in a text file) to a directory?

Steve

I have a list of files, with their full paths, one per line in a file "files.txt"

I was trying to move all of those files from their original location to a new directory.

I CDed into the directory where they live now and issued

for file in ~/Desktop/files.txt do mv $file ~/newfolder

but nothing happens. I am sure I am missing something obvious

Nifle

bash won't read the contents of the file unless you tell it to.

for file in $(cat ~/Desktop/files.txt); do mv "$file" ~/newfolder; done

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

List all file Name of a directory to Text File

From Dev

How to move files specified in a text file to another directory on BASH?

From Dev

How to move the files to new directory based on names in text file?

From Dev

Making a text file of list of directory entries in bin

From Dev

Move every file that is not a directory

From Dev

Move File in parent directory

From Dev

Filter directory list text file based on the short common root directory

From Dev

List file information in a text file for all the files in a directory

From Dev

List file names from a directory and place output in a text file

From Dev

Move file to relative parent directory

From Dev

Create separate text file to list the contents in each directory and subdirectory

From Dev

Command to move a file to a directory even if the directory is not present

From Dev

move_uploaded_file / No such file or directory in PHP

From Dev

list the multiple file in directory

From Dev

list: No such file or directory

From Dev

What is the simplest command line instruction in Ubuntu to export a directory file list to a text file?

From Dev

What is the simplest command line instruction in Ubuntu to export a directory file list to a text file?

From Dev

Move a file to another Ftp directory and rename it

From Dev

Make directories incrementally, move file into directory - loop

From Dev

Mass file+folder+directory move

From Dev

Move file to local ANT lib directory?

From Dev

How to move a file from a default directory to another?

From Dev

How to find a specific file and move it to a specific directory?

From Dev

Make directories incrementally, move file into directory - loop

From Dev

Move each file into its parent directory in linux

From Dev

if the file is a directory don't move it mv bash

From Dev

PHP move_uploaded_file for a directory uploaded

From Dev

Move files from one folder to another from a list of filenames from a text file

From Dev

.NET Directory.Move() vs File.Move()

Related Related

  1. 1

    List all file Name of a directory to Text File

  2. 2

    How to move files specified in a text file to another directory on BASH?

  3. 3

    How to move the files to new directory based on names in text file?

  4. 4

    Making a text file of list of directory entries in bin

  5. 5

    Move every file that is not a directory

  6. 6

    Move File in parent directory

  7. 7

    Filter directory list text file based on the short common root directory

  8. 8

    List file information in a text file for all the files in a directory

  9. 9

    List file names from a directory and place output in a text file

  10. 10

    Move file to relative parent directory

  11. 11

    Create separate text file to list the contents in each directory and subdirectory

  12. 12

    Command to move a file to a directory even if the directory is not present

  13. 13

    move_uploaded_file / No such file or directory in PHP

  14. 14

    list the multiple file in directory

  15. 15

    list: No such file or directory

  16. 16

    What is the simplest command line instruction in Ubuntu to export a directory file list to a text file?

  17. 17

    What is the simplest command line instruction in Ubuntu to export a directory file list to a text file?

  18. 18

    Move a file to another Ftp directory and rename it

  19. 19

    Make directories incrementally, move file into directory - loop

  20. 20

    Mass file+folder+directory move

  21. 21

    Move file to local ANT lib directory?

  22. 22

    How to move a file from a default directory to another?

  23. 23

    How to find a specific file and move it to a specific directory?

  24. 24

    Make directories incrementally, move file into directory - loop

  25. 25

    Move each file into its parent directory in linux

  26. 26

    if the file is a directory don't move it mv bash

  27. 27

    PHP move_uploaded_file for a directory uploaded

  28. 28

    Move files from one folder to another from a list of filenames from a text file

  29. 29

    .NET Directory.Move() vs File.Move()

HotTag

Archive