• 0 Posts
  • 2 Comments
Joined 4 years ago
cake
Cake day: January 21st, 2021

help-circle

  • I know this is a meme, but I actually find tar fairly easy to remember.

    tar -xf $archive is extract file

    tar -czf $archive dir/ is create zipped (compressed) file and the positional arguments are the files to add to the archive.

    And this is 99% of my usage. You can skip -f $archive to use stdin/stdout or use -C to change directory (weird name but logically tar always extracts to the current directory). There is also a flag to list which I always forget and lookup each time, but I list much less often. -v is useful for verbose.

    Overall there are much harder commands to remember. find always gets me if I go beyond -name. ps, tree and ls (beyond -Al) always get me to open the man page.