When my neighbor forgets to lock his computer, I append this to his bashrc

alias cd='cd $(ls -d */ | sort -R | head -1) && echo'

  • 0
    Can you please explain what it does to people which are not that familiar with that?
  • 9
    Yes. Cd is change directory in unix command line. You use it to navigate the file system. But here this alias makes anyone who uses the command change their location to a random directory instead.
  • 6
    Thanks for the explanation. I know basic terminal commands but I don't know things like that.
    Btw this is really sneaky 😄👍
  • 2
    @roxas jokes on you he uses ZSH :p
  • 1
    @skonteam I use zsh. And it works on it too
  • 1
    @roxas The implication was that adding this to the bashrc wouldn't have any effect if the person used zsh.
  • 1
    @boomi oh right! Ahahah
Add Comment