Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

(Use ^d instead of aliasing x to exit)

Use magit in emacs as a git front-end instead of dozens of git aliases. You can continue to use vi or eclipse or whatever for editing. Use dired in emacs to replace a lot of file manipulation aliases.

Replace all your complicated aliases with ^r reverse search. For example, instead of typing

    sudo dnf --refresh check-update
I type

    ^rche
because 'check' is the most distinct string in that command in my mind, and by 'che' bash has already located the last time I typed it in the history. Save lots of history:

    HISTSIZE=100000                   # Lots of history.
    HISTFILESIZE=100000               # Lots of history in the file.
    HISTCONTROL=ignoreboth            # Ignore entries with leading white space and dupes.
    HISTIGNORE="ls:ll:cd:fg:j:jobs"   # Uninteresting commands to not record in history.
    shopt -s histappend               # Append history to file, don't overwrite.
    shopt -s histverify               # Show expanded history before running it.
    shopt -s cmdhist                  # Store multiline cmds as single
Which directory is hiding all the bytes?

    alias dux='du -x --max-depth=1 | sort -n'
Machines on the local network:

    alias nwho='ping -b -c 2 255.255.255.255 2>&1 | grep "bytes from" | cut -d " " -f 4 | sort | uniq | sed -e "s/://g"'
Set the permissions to allow sharing of files in a directory between users in the same group (probably doesn't work on bsd/osx):

    function rwxs {
        find $1 -type d | xargs chmod u+rwx,g+rwxs,o+rx
        find $1 -type f | xargs chmod ug+rw,o+r
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: