2

I was trying to use tar command , --delete option and met some problems. There are two things I don't understand:

when using --verbose option with combination of --delete option, nothing shows as --verbose usually do, i.e. no show of deleted files. when using --totals option, the deleted size is always 0, it doesn't make sense and I can't figure out the meaning of these output.

Can anyone help me with these? The following code shows the procedure.

x@x:~/bin$ tar --list --file=pomo.tar
pomodoro
pomodoro_2
pomodoro_3
x@x:~/bin$ tar --append --file=pomo.tar quitpomo --verbose
quitpomo
x@x:~/bin$ tar --list --file=pomo.tar
pomodoro
pomodoro_2
pomodoro_3
quitpomo
x@x:~/bin$ tar --list --file=pomo.tar --totals
pomodoro
pomodoro_2
pomodoro_3
quitpomo
Total bytes read: 10240 (10KiB, 12MiB/s)
x@x:~/bin$ tar --delete --file=pomo.tar quitpomo --total --verbose
Total bytes read: 10240 (10KiB, 86MiB/s)
Total bytes written: 10240 (10KiB, 86MiB/s)
Total bytes deleted: 0
0

Have you looked into man tar for clues?!

NAME
tar — The GNU version of the tar archiving utility

SYNOPSIS
tar [-] A --catenate --concatenate | c --create | d --diff --compare |
--delete | r --append | t --list | --test-label | u --update | x
--extract --get [options] [pathname ...]

DESCRIPTION
Tar stores and extracts files from a tape or disk archive.

 The first argument to tar should be a function; either one of the letters
 Acdrtux, or one of the long function names.  A function letter need not be
 prefixed with ``-'', and may be combined with other single-letter options.
 A long function name must be prefixed with --.  Some options take a param‐
 eter; with the single-letter form these must be given as separate argu‐
 ments.  With the long form, they may be given by appending =value to the
 option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.