C
C
csergey2014-03-31 17:41:27
linux
csergey, 2014-03-31 17:41:27

How to specify multiple files as an argument to a Linux command?

For example, apply chmod +x to two files 1.sh and 2.sh at once.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2014-03-31
@jcmvbkbc

chmod +x 1.sh 2.sh.
The command, of course, must support this syntax. Many commands from coreutils support.

P
Pavel Kilin, 2014-03-31
@borodyadka

As jcmvbkbc pointed out:
or like this:
chmod +x {1,2}.sh

I
Ivan Starkov, 2014-03-31
@icelaba

Sometimes a command does not support multiple input files, then xargs is a great option
And a great replacement for xargs is gnu parallel www.gnu.org/software/parallel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question