Hacker News new | past | comments | ask | show | jobs | submit login

Or you just

    alias sl=ls
and have productivity reach unseen levels!



I've had "l" aliased to "ls -lhp" for so long that I can't work properly without it. I think many distros also alias "ll" to "ls -l" by default (I think CentOS/RHEL does it at least).


    alias l="tree --dirsfirst -ChFL 1"
    alias l2="tree --dirsfirst -ChFL 2"
    alias l3="tree --dirsfirst -ChFL 3"
    alias l4="tree --dirsfirst -ChFL 4"
    alias l5="tree --dirsfirst -ChFL 5"
( or https://github.com/ogham/exa in tree mode )


I, too, have "l" aliased, but years of muscle memory I still type "ls -lahp" every single friggin' time. Hey, at least it's portable when I'm ssh'd to another system.


I have h=ls and hh=ls -l, which are much more comfortable with the Dvorak keyboard layout. (The equivalent would be j and jj on Qwerty.)


I aliased d instead. I also have ll and la but I don't use them that often so didn't change them to be Dvorak optimized.


Good idea. Dvorak users unite!

Do you use regular dvorak or programmer dvorak?


British Dvorak, since it keeps ", £, # etc where I expect them, but is still a standard layout available on Linux and Mac.


I have l aliased to -lhrt since it’s what I mostly need.


I have a few "idiot aliases" like that...

  alias grpe=grep
  alias gerp=grep


> grpe

Every. Single. Time. Sometimes I even typo it many times in a row.

There must be //something// in that combination of letters, because I don't recall ever having that many mistakes with any other commands.


I think that many of my typos occur when switching between letters on one hand vs the other. I figure it's a brain hemisphere synchronization thing.


    alias gti='/usr/local/bin/git'
    alias gut='/usr/local/bin/git'


My personal favorite is:

   alias fuck='sudo $(fc -nl -1)'
Be very careful with this.


Here's one of my aliases for you:

    function fuckgit
        rm -rf /tmp/fuckgit/
        git clone --no-checkout (git config --get remote.origin.url) /tmp/fuckgit/
        rm -rf .git/
        mv /tmp/fuckgit/.git .
        rm -rf /tmp/fuckgit/
    end


What about the actual program thefuck? It can fix more than just sudo, and asks you to confirm



I don't want to be asked and I don't want to install anything.

I looked at thefuck but it didn't seem to do anything I needed.


Or make history work for you:

  shopt -s histverify histreedit
Bash will let you then confirm the actual command it's going to run:

  sudo !!


I use zsh and I don't know what shopt is. That's two commands and !! doesn't work in aliases.


In zsh it is called setopt. You don't need to make an alias, you would put this in your .bashrc


So why not just type 'sudo !!' ?


Because it isn't as much fun.


I think you can try this. https://github.com/nvbn/thefuck


I generally have this in my bash_aliases

    alias ls='ls -lah --color="auto"'
    alias l='ls -lah --color="auto"'
    alias ll='ls -lah --color="auto"'
    alias sl='ls -lah --color="auto"'


For some reason the typo I tend to make the most is ';s', so I've gone ahead and set `alias s=ls`


I mean, yeah, you could, but that's not as much fun.


I've set alias ls=sl in dozens of systems belonging to colleagues over the years, just for the lulz! :D :D


This program reverses the output.


alias lsd="ls -d */"




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

Search: