Other useful command:
1. nm –list symbols from object files
2. ar crv libfoo.a bill.o foo.o
gcc –o hello hello.c libfoo.a
or gcc –o hello hello.c –L. –lfoo
Redirect:
Redirecting output:
$ls –al > output.txt (if output.txt exist: overwriting the output.txt
$ls –al >> output.txt(if output.txt exist, append the output.text)
$ kill -HUP 1234 >killout.txt 2>killerr.txt (will put the output and error information into separate files.)
$ kill -1 1234 >killouterr.txt 2>&1(f you prefer to capture both sets of output into a single file, you can use the >& operator to combine the two outputs. Therefore,)
$ kill -1 1234 >/dev/null 2>&1 (you don’t often want to save either standard output or standard error. You can use the Linux universal “bit bucket” of /dev/null to efficiently discard the entire output, like this:)
Redirecting input:
Rather like redirecting output, you can also redirect input. For example,
$ more < killout.txt