Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
/ extra-cd Public archive

Change to directories with shortcut names in Linux Terminal.

License

Notifications You must be signed in to change notification settings

bashf/extra-cd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change to directories with shortcut names in Linux Terminal.

  1. Download bash script.
  2. Set execute permission on the bash script, and copy to ~/scripts.
  3. Source the script in .bashrc: echo "source <path to ecd>" >> ~/.bashrc.
$ ecd [- | [+<shortcut> [path] | -<shortcut> | =<shortcut>]]

# [] -> optional argument
# <> -> argument value
# change to workspace directory
$ ecd /local/mnt/workspace

# change to up one directory
$ ecd ..

# stay at current directory (list contents)
$ ecd .

# change to previous directory
$ ecd -

# add current directory as shortcut
$ ecd +work

# change to root directory
$ ecd /

# change to workspace directory using shortcut
$ ecd =work

# remove workspace shortcut
$ ecd -work

# add relative path shortcut
$ ecd +up3 ../../..

# go up 3 directories
$ ecd =up3

# remove relative path shortcut
$ ecd -up3

bashf