Another way to temporarily change the directory is to put the
tar commands inside the parenthesis
(cd example/super_user; tar -cvf ../../result.tar *)
The advantage of this, is, that you will always implicitly pop back to the original directory when the block is done. Another advantage is that the use of the wildcard
* in this instance, will match the filenames in the temporary directory. i.e. no need for
popd blocks or keeping track of where to
cd back to.
Alternative to the above, there is a special
cd - command which toggles/undoes the last change directory, e.g.
cd example/super_user # change to a subdirectory
tar -cvf ../../result.tar *
cd - # undoes the change to the subdirectory