tar

Change directory

For example, create a tarball of the contents of /var/www/html/foobar and have the tarball unpack into the foobar directory:

tar -C /var/www/html/ -jcf foobar.tar.bz2 foobar/

List files

Usually, less will work. Otherwise:

tar -tf files.tar.gz