Date: Sat, 4 Nov 1995 21:35:29 -0500 (EST) From: Chuck Robey <chuckr@glue.umd.edu> To: Blair Schmittel <blair@strech.cyber-naut.com> Cc: questions@freebsd.org Subject: Re: taring files Message-ID: <Pine.SUN.3.91.951104212021.6913A-100000@cappuccino.eng.umd.edu> In-Reply-To: <199511042001.UAA26134@strech.cyber-naut.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 4 Nov 1995, Blair Schmittel wrote: > Hello, > > I have been trying to tar a few subdirectories for weeks. It just won't work. > > What I am trying to do is tar the subdirectory of /etc/raddb into a radius.tar file. The device is /dev/wd0a. Can anybody show me the command syntax. > > BTW, I have read the man pages... About 5 times. cd into the directory you want to tar. I'll make the assumption that your home directory is ~blair, and you want the tar file to be named "stuff.tar". Here's the syntax: tar -cf ~blair/stuff.tar [list of files to include in tar] A very common error is the assume that the parameter that follows the -cf is the file list. As you can see, it's the name of the file that gets the output of the tar. If the whole directory is to be tarred, you can either put "*" as the file list, or cd to the parent directory and give the name of the directory to be tarred. Don't do this from your home directory, tar will assume the entire pathway from root, or some relative path, and make the unpacking operation less simple to accomplish. On some machines, this could make the tar file nearly useless. What you want is called a 'relative' tar, where only the names of the files, or (better) the name of the whole directory is in the tar file, not a whole path from root. One last note: it's a kindness to tar from the parent, getting the whole directory. That way, when it unpacks, the tar will go into a directory, and not clutter up some poor user's home directory. I get caught by this once in a while, when I don't check first how a tar will unpack. How will a tar unpack? 'tar -tvf' (or 'tar -tzvf if it's gzipped) will give you a file list. Good idea to check your tar file this way, anyways. Lots of other tar tricks, give that man page a reread when you get a little more confidence in the basic procedure. ========================================================================== Chuck Robey chuckr@eng.umd.edu, I run FreeBSD-current on n3lxx + Journey2 Three Accounts for the Super-users in the sky, Seven for the Operators in their halls of fame, Nine for Ordinary Users doomed to crie, One for the Illegal Cracker with his evil game In the Domains of Internet where the data lie. One Account to rule them all, One Account to watch them, One Account to make them all and in the network bind them.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.951104212021.6913A-100000>