Mark the files using one of ways detailed here. (E.g. type mf
with the cursor over a filename.)
Type mx
At the prompt enter your shell command.
- If you want to specify where marked files should be inserted in the command line indicate this with a
%
.
- Alternatively, don't add a
%
and marked files will follow the command after a space.
Hit Enter.
The command should then be run on each file in turn.
The example found in the relevant section of netrw docs
(mark files)
mx
Enter command: cat
The result is a series of shell commands:
cat 'file1'
cat 'file2'
...
If instead you want the command run once on all the files at one time use mX
instead of mx
.
The documentation example for that one, showing creation of a tarball:
(mark files)
mX
Enter command: tar cf mynewtarball.tar
The command that will be run with this example:
tar cf mynewtarball.tar 'file1' 'file2' ...