Help for hard-to-remember terminal commands...
Posted: Mon Jan 27, 2014 12:01 pm
I found this mentioned on the Linux Action Show:
http://bropages.org/
(Just get to the point!)
It gives examples in a human-readable manner for common CLI commands.
You need to be connected to the Net, install ruby (M11 and M12 are new enough, haven't checked 8.5) and run
and to keep it current:
For example, "bro tar" gives
http://bropages.org/
(Just get to the point!)
It gives examples in a human-readable manner for common CLI commands.
You need to be connected to the Net, install ruby (M11 and M12 are new enough, haven't checked 8.5) and run
Code: Select all
su -c 'gem install bropages'
Code: Select all
su -c 'gem update bropages'
Code: Select all
bro tar
4 entries for tar -- submit your own example with "bro add tar"
# Create a tar archive
tar -cf archive.tar file1 file2 ... fileN
# Create a tar gzipp'd archive
tar -zcf archive.tar.gz file1 file2 ... fileN
# Create multi-part tar archives from a directory
tar cf - /path/to/directory|split -b<max_size_of_part>M - archive.tar
# Extract all files from a tar archive
tar -xf archive.tar
# Extract all files from a tar gzipped archive
tar -zxf archive.tar.gz
# Extract one file from a tar archive
tar -xf archive.tar the_one_file
# Lists all files in a tar archive
tar -tf archive.tar
bro thanks to upvote (40)
bro ...no to downvote (0)
...............................................................................................................................................
# Create a tar file:
tar cf archive.tar file1 [...]
# Create a compressed tar file:
tar cjf archive.tar.bz2 file1 [...]
# Create a older compressed tar file:
tar czf archive.tar.gz file [...]
# Extract a .tar, .tar.gz, .tgz, .tar.bz, or .tbz2 file:
tar xf archive.tbz2
# list the files inside the archive:
tar tf archive.tar
bro thanks 2 to upvote (1)
bro ...no 2 to downvote (0)
...............................................................................................................................................
# unpacking stuff with tar is obnoxious
# heres a useful shell script for unpacking with tar
# throw it in your .bashrc as a function or whatever.
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xvjf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.tar) tar xvf "$1" ;;
*.tbz2) tar xvjf "$1" ;;
*.tgz) tar xvzf "$1" ;;
*.tar.xz) tar xJf "$1" ;;
*) echo "don't know how to extract "$1"..." ;;
esac
else
echo ""$1" is not a valid file!"
fi
bro thanks 3 to upvote (6)
bro ...no 3 to downvote (9)
...............................................................................................................................................
# unpacking stuff with tar is obnoxious
# check out unp (unpack (almost) everything)
brew install unp
apt-get install unp
bro thanks 4 to upvote (5)
bro ...no 4 to downvote (19)
(END)