hi. Does this command (tar cvf /usr/local/bin) create a tape achieve in /usr/local and then copies all the files and directories that are in the /bin directory into the tape archive that is stored in /usr/local?
If not then how does it work? I have looked around the internet and that's the answer that I came up with.
Cheers
No. Double-check the man page. You'll see the 'f' option requires a value, specifically the name of the destination tar is to use. (UNlike many commands, tar doesn't require that 'f's value follow it immediately; this, of course, makes it a little harder to understand until your neural pathways become accustomed to the pattern.
Assuming your tape device is /dev/nrst0, the following three lines commands are 'equivalent', though the final result is not necessarily the same:
tar cvf /dev/nrst0 /usr/local/bin
tar cvf - /usr/local/bin | dd of=/dev/nrst0 bs=1024k
tar cvf /tmp/ulb.tar /usr/local/bin; dd if=/tmp/ulb.tar of=/dev/nrst0 bs=1024k
All three commands get the tar file to the tape, but do it differently. (Aside, depending on the underlying system, the first command may set the tape drive to use 10KB blocks, while the latter two may set it to use 1MB blocks; this can affect tape portability.)