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

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Post Reply
Message
Author
User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

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

#1 Post 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)

User avatar
GoManutd
Posts: 25
Joined: Mon Jun 30, 2008 8:06 pm

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

#2 Post by GoManutd »

the running joke for *nix commands was simply remove all vowels...

User avatar
EEEDDD
Posts: 1
Joined: Mon Sep 18, 2017 11:04 am

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

#3 Post 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

User avatar
bwich12
Posts: 20
Joined: Tue Jul 12, 2016 9:14 am

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

#4 Post by bwich12 »

@EEEDDD: Thanks for that link.This looks interesting.

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

newkansan
Posts: 28
Joined: Mon Jul 21, 2014 4:33 pm

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

#5 Post 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.
Acer Aspire 7736Z-4088
Pentium T4400 2.2Ghz, Intel GMA 4500M
4GB RAM, 500GB WDC_WD5000LPLX
MX-15 64-bit

Post Reply

Return to “Tips & Tricks by users”