utility-option

tar -cf

Create an archive from a known member. Check creation status; the lab does not read a real backup source.

Formal Syntax & Structure

bash syntaxbash
tar -cf ARCHIVE -C DIRECTORY MEMBER

Return Value

exit status

Create an archive from a known member. Check creation status; the lab does not read a real backup source.

Working Example

Example Snippetbash
mkdir -p sourceprintf 'hello\n' > source/note.txttar -cf backup.tar -C source note.txt || exit 1tar -tf backup.tar
Bash Reference