Is there a way to exclude only folders?
I want to move all files from my download folder to a specific folder automatically via shortcut,
but folders should stay in the download folder. Any suggestions?
Thanks
I have a solution that involves a… shell script.
(Quelle surprise…)
find "$HOME/Downloads" -maxdepth 1 -mindepth 1 \! -type d -exec mv -v -n {} "$HOME/Some/Folder Name/Here/" \;
You could trigger that with a Keyboard Maestro shortcut.
Here's the breakdown…
-
find "$HOME/Downloads"
Hopefully this is obvious, but it says to look in the "Downloads" folder in your$HOME
directory. -
-maxdepth 1
Don't descend into any sub-folders found in$HOME/Downloads
-
-mindepth 1
This effectively excludes the$HOME/Downloads
folder itself and makes sure we are inside the folder itself. -
\! -type d
Find everything that is not Âtype d
… andd
stands fordirectory
(akafolder
) -
-exec mv -v -n {} "$HOME/Some/Folder Name/Here/" \;
-
-exec
means “execute the following shell command” -
{}
means “any results of thefind
command” -
\;
means “this is the end of the shell command” -
mv -v -n
meansmove
verbosely-v
but “not overwriting” (-n
) -
"$HOME/Some/Folder Name/Here/"
is the directory/folder that you want to move the not-folders to.
Questions? Let me know.
This can be done easily using all native, non-scripting KM Actions.
Let us know if you are interested.
I am, I was searching for it for a while