hi i am a newbie to linux i have been in touch with linux server for quite a long but thru telnet .REcently ihave switched entriely to RED HAT LINUX so please help me as and when needed and mail me regular updates.....
and tell me all options of tar function

Dani AI

Generated

A short, practical tar cheat‑sheet for Red Hat (GNU tar). asked for the options, and pointed to the system help — that is useful, but here are the everyday commands and gotchas you will actually use.

Create, list and extract (common tasks):

# create a gzip-compressed archive
tar -czvf backup.tar.gz /path/to/dir

# list contents of a compressed archive
tar -tzvf backup.tar.gz

# extract into a target directory
mkdir -p /restore
tar -xzvf backup.tar.gz -C /restore

# extract a single file from the archive
tar -xzvf backup.tar.gz path/inside/archive/file.txt -C /target

Modify archives and filtering:

# append files (works only on uncompressed .tar files)
tar -rvf archive.tar newfile.txt

# update only if file is newer than archive copy
tar -uvf archive.tar updated/file

# concatenate two uncompressed archives
tar -Af base.tar extra.tar

# exclude patterns when creating
tar -czvf site.tar.gz --exclude='*.log' /var/www

Quick tips and traps to avoid

  • Most Linux distributions (including Red Hat) ship GNU tar; options above apply. Check the local manual for any distro-specific differences.
  • You cannot append/delete inside a compressed archive. To change one, decompress (or recreate) the archive.
  • Use -p on extract to preserve permissions and --same-owner if restoring as root and you want original ownership.
  • By default tar avoids writing absolute paths; use -P if you really must preserve leading "/" (be careful).
  • If extraction fails with permissions, extract as root or to a directory you own. If compression type is unknown, use file archive.tar.* to detect it.

This covers the most useful workflows for everyday backups and restores. For a full option list consult your system man page.

at a bash prompt type "tar --help" and that will tell you every option with a description

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.