Shell Aliases For Easy Directory Navigation #OneDevMinute
Ahmad Awais ⚡️

Ahmad Awais ⚡️ @ahmadawais

About: VP of DevRel RapidAPI ❯ Award-winning Web Developer NodeCLI.com ❯ Google Dev Expert Web tech ❯ 2x GitHub Stars Award ❯ WordPress Core Dev ❯ TEDx Speaker ❯ "awesome example for devs" — Satya Nadella

Location:
San Francisco Bay Area
Joined:
Feb 19, 2017

Shell Aliases For Easy Directory Navigation #OneDevMinute

Publish Date: Sep 21 '18
42 8

🔥 #OneDevMinute is my new series on development tips in one minute. Wish me luck to keep it consistent on a daily basis. Your support means a lot to me. Feedback on the video is welcomed as well.

Ever had that typo where you wrote cd.. instead of cd .. — well this tip not only addresses that typo but also adds a couple other aliases to help you easily navigate through your systems directories. More in the video…

OneDevMinute

################################################
# 🔥 #OneDevMinute
#
# Daily one minute developer tips.
# Ahmad Awais (https://twitter.com/MrAhmadAwais)
################################################

# Easier directory navigation.
alias ~="cd ~"
alias .="cd .."
alias ..="cd ../.."
alias ...="cd ../../.."
alias ....="cd ../../../.."
alias cd..="cd .." # Typo addressed.
Enter fullscreen mode Exit fullscreen mode

Copy paste these aliases at the end of your .zshrc/.bashrc files and then reload/restart your shell/terminal application.

If you'd like to 📺 watch in 1080p that's on Youtube →
This is a new project so bear with me. Peace! ✌️

Comments 8 total

  • Fabio Perrella
    Fabio PerrellaSep 21, 2018

    You can use autojump to change folders faster

  • Darryl Norris
    Darryl NorrisSep 22, 2018

    I never thought about the adding the typo as an alias, very neat idea.

    alias cd..="cd .." # Typo addressed.
    
  • Sean Henderson
    Sean HendersonSep 22, 2018

    cd without any arguments will default to ~

  • Shailendra Gupta
    Shailendra GuptaSep 22, 2018

    alias -="cd -"
    To go last working directory

  • Azez Nassar
    Azez NassarSep 23, 2018

    Here are some of the aliases I'm using, hopefully someone might find one useful.

    # Shortcuts
    alias db="cd ~/Documents/Dropbox"
    alias dl="cd ~/Downloads"
    alias dt="cd ~/Desktop"
    alias p="cd ~/Projects"
    alias g="git"
    
    # List all files colorized in long format
    alias l="ls -lF -G"
    
    # List all files colorized in long format, including dot files
    alias la="ls -laF -G"
    
    # List only directories
    alias lsd="ls -lF -G | grep --color=never '^d'"
    
    # Always use color output for `ls`
    alias ls="command ls -G"
    
    # Always enable colored `grep` output
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    
Add comment