How may I drag several folders into the MATE terminal and run a command on them consecutively?

For example:

I drag three folders into the terminal and I get '/directory1/' '/directory2/' '/directory3/' is it possible to then run commands on each of these folders one after the other? Like ls | sort or other commands?

Well, you can type the command (for example, ls | sort, to use your example), move the command prompt cursor over to where you want the folder names to go (in this case, the cursor should be between the space after ls and the pipe character), and then drag the folders into the terminal.

An example in pictures:

1 Like

Wow, that's so simple and incredibly helpful! I'm totally new to Linux and MATE, but we use it at work and it seems to me like a lot of manual labour could be automated away with simple commands.

The specific command I want to run seems to be unique to our studio. It's used by jmp server | command [drag folder here] But unfortunately the command only accepts one argument at a time. Do you have any idea how I could drag or otherwise select my target folders and then run this command on each of them? Or perhaps if you could point a noob like me to documentation that would get me started on such a task? Thank you.


Something like this ?

for folder in [drag your multiple folders here] ; do jmp server | command "${folder}" ; done

1 Like