the \
character allows you to break your command into multiple lines :
$ grep "hello" /tmp/file
is equivalent to :
$ grep "hello" \
> /tmp/file
the '
and "
character allows you to define multiline strings, and the `
is a way to use the output of a command as an argument to another. $(command)
does the same thing.
whenever you see
>
it means that the command syntax is not complete. Some shell constructs also needs to be terminated, like while, for, if ...
The displayed >
can be configured with the PS2 environnement variable.
as requested, here is an example using `
:
suppose i have a list of files into filelist.txt
:
$ cat filelist.txt
a.c
a.h
Makefile
test.cfg
[...]
i want to know the number of lines in each of those files. the command would be wc -l a.c a.h Makefile [...]
. to use the output of the cat filelist.txt
as arguments to wc -l, i can use :
$ wc -l `
> cat filelist.txt
> `