What does the -C option do in the tar command?

0330

The -C option in the tar command is used to change to a specified directory before performing the extraction or archiving operation. This allows you to specify where the files should be extracted or where the files to be archived are located.

For example, in the command:

tar -xvf archive.tar -C /path/to/directory

The -C /path/to/directory part tells tar to change to /path/to/directory before extracting the contents of archive.tar.

0 Comments

no data
Be the first to share your comment!