Re: move/copy file by extension preserving directories hierarchy.



On Wed, 22 Oct 2014 15:25:27 -0700, tizio incognito <jeeglio yahoo it> wrote:

I don't know if it has benn already asked, but it could be a nice feature the possibility to move/copy files recursively by extension preserving the directory structure. I'll better explain by an example:


src dir
|
+- sub dir 1

|  +- file1.png

|  +- file1.jpeg

|

+- sub dir 2

   +- file2.png

   +- file2.jpeg


command: move_by_ext *.pngsrc_dir dest_dir

dest dir
|
+- sub dir 1

|  +- file1.png

|

+- sub dir 2

   +- file2.png


Thanks in advance
Daniele Giglio

I say this is a job for the F2 menu. That's where you can get
all picky and funny with stuff like this. I have never once
required this nitpicking of directory contents in 20 years of
using mc, but I have many other bizarre scripts that do oddball
things like this that I personally require all the time, so
I'll give you a hint:

tar cvf test.tar $(find /path/to/dir -name '*.png')

then move the test.tar where you want, and un-tar it.


--
Peace and Cheer


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]