Get the source
wget "http://www.sentex.net/~mwandel/jhead/jhead-2.97.tar.gz"
Untar the source
tar xzf jhead-2.97.tar.gz
Or, get and untar the source in one step
curl "http://www.sentex.net/~mwandel/jhead/jhead-2.97.tar.gz" | tar xz
Now you have a directory called jhead-2.97
. Enter that directory and run make
.
cd jhead-2.97
make
This will compile the code and link an executable for you called jhead
.
Some makefiles have install targets. This one does. To install the executable,
make install
You'll probably need to run that as root. Now your program is installed and ready for use.
In this case, the install target looks like this:
cp jhead ${DESTDIR}/usr/local/bin/
If you ever run into a program without an install target in its makefile, just know that you have to get any executables into /usr/local/bin
and any libraries into /usr/local/lib
(or other appropriate locations.) Sometimes there are also other files you have to worry about such as documentation files (e.g. man pages), configuration files, etc.
I think you can do this with the -C
option.
From the tar man page:
-C directory, --cd directory, --directory directory
In c and r mode, this changes the directory before adding the following files.
In x mode, change directories after opening the archive but before extracting
entries from the archive.
This means that you should be able to run
tar cvzf result.tar.gz -C /path/to/dir1/ . -C /path/to/dir2/ .
to achieve what you want.
Best Answer
With
zsh
, using process substitution and itstee
-like behaviour when you redirect a file descriptor several times:With other shells with support for process substitution (ksh, bash):
POSIXly on systems with
/dev/fd/x
:To do if for several
tar.gz
files, that's just (still inzsh
)Note that the files will be extracted at the speed of the slowest destination drive.
Another approach could be to run extractions for both drives in parallel (here using POSIX
sh
syntax):However note that:
tar.gz
file could end up being read twice from the source disk as it could end up being evicted from the cache which would result in more I/O on your machine.