Frequent Shell Tasks Done Right
Publish date: Jul 13, 2019
Last updated: Apr 22, 2020
Last updated: Apr 22, 2020
tar use-case
Extract packages directly to
/.local/bin
and stop polluting$PATH
environment variable everytime you install something new
Installing go
tar -C /usr/local -xzf go1.12.7.linux-amd64.tar.gz
Installing node + npm
tar \
--interactive \
--verbose
--extract \
--directory=/home/avi/.local/ \
--strip-components=1 \
--file=node-v10.16.0-linux-x64.tar.xz
--list
- print output, avoid this if you like quiet mode
- extract
tar.xz
archive bundle cd
to this directory before extracting archive file- Avoid creating top-level directory with the same name as archive ball
- location of file to extract
Footnotes
[^2]: