Custom Linux Copin...
 
Notifications
Clear all

Custom Linux Coping Tool

4 Posts
4 Users
0 Likes
408 Views
(@abbadi)
Posts: 1
New Member
Topic starter
 

Hi all,
I am looking for a Linux tool(command line based) that allows me to choose the file extensions I want to accuire, example I want to copy from the target Hdd (*doc) and (*PDF) files only!

Hint I am trying to develop a lite Linux OS the supports what I mentioned above

 
Posted : 15/11/2018 7:04 pm
(@mscotgrove)
Posts: 938
Prominent Member
 

Imaging normally refers to taking a copy of the raw hard drive (or other media). Imaging is typically only concerned with sectors and not the contents, or file system.

You appear to want a selective copy and not an image.

 
Posted : 16/11/2018 10:41 am
azrael
(@azrael)
Posts: 656
Honorable Member
 

As with all *NIX based operating systems, you are able to chain together various tools to accomplish the task that you are trying to achieve

find . -name *.doc -exec cp --parents '{}' /destination/directory

The above, for example, would copy all of the files (and only the files) with the .doc extension to a directory structure that is analogous to the source within another directory.

For example the file /home/azrael/file.doc would be copied to /destination/directory/home/azrael/file.doc …

You could do it flat (e.g. copy all of the found files into the same directory) by omitting the "–parents" - depends upon what you want to do with the files once you have them - also, bear in mind that as the file system won't allow two files of the same name in the same directory, this reduces the issue of a file with the same name overwriting another …

As mscotgrove points out though - this is not imaging - this is selective copy, and it has no idea about the contents of the files, so it might copy things that have the .doc suffix, but aren't "Word" files, or it may miss "Word" files that have had the suffix changed. That's not to say that the above isn't useful - just you do need to be aware of the limitations, especially for evidence…

There are multiple ways of doing this in *NIX - so I'd suggest that you spend some time looking at the basic command line tools to find the ones that suit you the most …

 
Posted : 16/11/2018 12:52 pm
(@chad131)
Posts: 63
Trusted Member
 

Paladin Toolbox will let you do this as well. Also, if you are going to use find, make sure and use -iname so its case insensitive and you catch .Doc, .DOC, .doc, .PDF, .pdf etc…

 
Posted : 21/11/2018 6:46 pm
Share: