• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Batch transfer files (terminal) (redirected from batch transfer files (terminal))

Page history last edited by Monica 11 years, 2 months ago Saved with comment

How to copy/move multiple files from a single directory into different subfolders

 


 

NB: filenames should not contain blank spaces or special characters (e.g. &, %, !, (, etc)

 

Step 1 : Extract simple list of filenames

Navigate to source directory and run ls command

 

\

 

 

 

 

 

 

 

 

Figure 1 : list command output to screen and saved to text file

 

NOTE: In this example, all converted files have been saved to a single folder (e.g. path/output). Converted files may be access versions (*.mp4) or master versions (*.mov)

 

Step 2 : Get path to destination directory

Change directory (type “cd”) and drag top folder to terminal screen and press enter

Enter “pwd” command to get full path of destination directory

 

Figure 2 : Destination Directory Path

 

 

Step 3 : Create commands

In excel: Create table with following columns

 

column

value

description

1st

cp

copy command (to move files instead of copy, replace cp with mv)

2nd

filenames

Data from step 1 (drag filenames.txt to MS Excel icon to open)

3rd

Destination path/sub folder

Path to destination directory (from Step 2) plus name of object folder. The object folder is the digital id value.

 

TIP: create data using excel formulas =CONCATENATE($B$1,"/",LEFT(B18,8))

 

4th

|

Pipe symbol (for all rows except last)

 

 

Figure 3 : Excel screen shot

 

 

Step 4 : Clean up spacing

In MS word

  • Copy range of data from Step 3 and paste special>unformatted text into MS word

  • Remove any hard returns (search and replace tabs ^t with single space)

  • Edit/Select All

Figure 4 : Using search, find all tabs (shown in yellow highlights)

 

Step 5 : Run commands

In terminal

  • Go to source directory (cd + drag folder)

  • Paste commands

 

TIP: as proof of concept recommend first test single command and confirm file has been copied as expected

 

 

Step 6 : Verify

Spot check using finder

 

 

 

Comments (0)

You don't have permission to comment on this page.