What does the '-c' option do in the 'tar' command?

091

The -c option in the tar command is used to create a new archive. When you use tar -c, it tells the tar command that you want to create an archive file.

For example, the command:

tar -cvf archive_name.tar directory_name
  • -c: Creates a new archive.
  • -v: Makes the operation verbose, showing the files being added to the archive.
  • -f: Specifies the name of the archive file to create.

In this example, archive_name.tar will be created containing the contents of directory_name.

0 Comments

no data
Be the first to share your comment!