Page 1 of 1

Help for hard-to-remember terminal commands...

Posted: Mon Jan 27, 2014 12:01 pm
by Stevo
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

Code: Select all

su -c 'gem install bropages'
and to keep it current:

Code: Select all

su -c 'gem update bropages'
For example, "bro tar" gives

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)

Re: Help for hard-to-remember terminal commands...

Posted: Mon Jan 27, 2014 6:08 pm
by GoManutd
the running joke for *nix commands was simply remove all vowels...

Re: Help for hard-to-remember terminal commands...

Posted: Mon Sep 18, 2017 11:22 am
by EEEDDD
I think that using "Marker" is a good tip. I can't live without it (https://github.com/pindexis/marker)
Marker is a command palette for the terminal. It lets you bookmark commands (or commands templates) and easily retreive them with the help of a real-time fuzzy matcher. It's also shipped with many commands common usage(Thanks to tldr).
I use it with the default keybindings:
Ctrl-space: search for commands that match the current written string in the command-line.
Ctrl-k (or marker add): Bookmark a command.
Ctrl-t: place the cursor at the next placeholder, identified by '{{anything}}'
marker remove: remove a bookmark


Here a gif image of it
Image

Re: Help for hard-to-remember terminal commands...

Posted: Wed Sep 20, 2017 5:08 am
by bwich12
@EEEDDD: Thanks for that link.This looks interesting.

@All: What goodies do you use to make command-line typing less tedious?

Re: Help for hard-to-remember terminal commands...

Posted: Wed Sep 20, 2017 7:11 am
by newkansan
bwich12 wrote:@EEEDDD: Thanks for that link.This looks interesting.

@All: What goodies do you use to make command-line typing less tedious?
I have a simple text file that I keep in Dropbox that I store terminal commands and their meanings in, that are relevant to me. That way it is accessible on all of my systems.