find
can take -o
for "or", so you can combine your two find
commands like so:
find . \( -type f -o -type d -empty \) -print0 | tar ...
Or, if you can guarantee all the files can fit on one command line,
find . \( -type f -o -type d -empty \) -exec tar cvfz files.tgz {} +
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.
Best Answer
A plain
.tar
archive created withcf
(with or withoutv
) is uncompressed; to get a.tar.gz
or.tgz
archive, compress it:You might want to add
-9
for better compression:Both variants will leave both archives around; you can use
instead, which will produce
my_files.tar.gz
and deletemy_files.tar
(if everything goes well). You can then renamemy_files.tar.gz
tomy_files.tgz
if you wish.With many
tar
implementations you can extract archives without specifying thez
option, andtar
will figure out what to do — so you can use the same command with compressed and uncompressed archives.