I recommend reading a book on unix or Linux shell and command line usage, in order to learn basic usage and get a feeling for some advanced features. Then you can turn to reference documentation.
The usage of specific commands is described in their manual. man cat
will show the manual of the cat
command on your system. Manual pages are usually references, not tutorials, though they often contain examples. On Linux, cat --help
shows a terse usage message (meant for quick perusal when you already know the fundamentals and want to find an option for a specific task).
The POSIX standard specifies a minimum set of commands, options and shell features that every unix system is supposed to support. Most current systems by and large support POSIX:2004 (also known as Single UNIX version 3 and the Open Group Base Specifications issue 6). GNU software (the utilities found on Linux) often have many extensions to this minimum set.
There are common conventions for command-line arguments. POSIX specifies utility conventions that most utilities follow, in particular:
- Options consist of
-
followed by a single letter; -ab
is shorthand for -a -b
.
--
signifies the end of options. For example, in rm -- -a
, -a
is not an option but an operand, i.e. a file to act upon, so this commands removes the file called -a
.
- A lone
-
stands for standard input, where an input file is expected. It stands for standard output where an output file is expected.
GNU utilities and others also support “long options” of the form --name
. Some utilities go against the general convention and take multi-letter options with a single leading dash: -name
.
Redirection is a shell feature, so you'll find it in your shell's manual. <<<
to use a string as standard input is a ksh extension, also supported by bash and zsh. As long as the shell supports it, it can be used on any command.
If you have already running wget http://first
in foreground you can pause it with CTRL+z and then return it back to work with another command right after it:
fg ; wget http://second
It should work in most cases.
If that way is not acceptable, you should go with lockfile. Or even just to monitor the process via ps
(lockfile is better).
Best Answer
That's what
xargs
does.