Skip to main content

All Questions

Tagged with
134 votes
36 answers
73k views

Quick directory navigation in the bash shell

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/. But I don't want to type cd /[full-path]/...
saiy2k's user avatar
  • 1,603
36 votes
4 answers
63k views

Alias to CD in a directory and call a command

I have a .bash_profile and in that I have a set of aliases. Those aliases at the moment execute only a single command and it was fairly easy. I would however like to do two things with a new alias ...
user232103's user avatar
21 votes
4 answers
3k views

Automatically detect when I typed "vi" but meant "cd"?

About 5 times a day, I type "vi" when I meant "cd", and end up opening a directory in vi. It's making me NUTS. It seems like there should be a way to detect when I type in "vi + directory" and ...
Alex's user avatar
  • 323
20 votes
2 answers
11k views

Change directory without typing cd?

Is it possible to make bash change directory in command line simply by typing that directory without any commands like cd? For example is it possible instead of writing this: $ cd /tmp I just want ...
Vladimir's user avatar
  • 310
8 votes
4 answers
9k views

How to create a short path?

We have so many useful folders, which are in different path, for our working in Linux. For example : $ cd ~/Documents/Courses/EDX/physics2013/ $ cd ~/Documents/Company/OpenGL/Proj/... $ cd ~/...
Gapry's user avatar
  • 245
8 votes
2 answers
24k views

Creating an alias to Change Directory and have that directory be the current working directory in new terminal tabs

I'm trying to create a convenience alias that will change directories and then start a node server in that directory. I have it working for the most part, there's just one little issue that I can't ...
Scott's user avatar
  • 181
6 votes
3 answers
6k views

-bash: /bin/cd: No such file or directory - automatically execute ls after cd

I accidentially destroyed my cd command. I tried to automatically execute ls after cd is called. I found a post saying that I have to execute alias cd='/bin/cd && /bin/ls', but now I get -...
Black's user avatar
  • 2,098
6 votes
4 answers
20k views

Command line shortcuts for changing directory [duplicate]

I'm looking for an easy way to navigate to directories spanning multiple hard drives and want to set something equivalent to a shortcut within the terminal. In Windows I would accomplish this with ...
user1695505's user avatar
4 votes
1 answer
3k views

How to declare some aliases dynamically in zsh?

I would like to declare a few shortcut commands to switch between my various coding projects, so I have come up with the following script. projects=$(ls -d ~/Workspace/*/) prefix="/Users/myuser/...
le-doude's user avatar
  • 143
4 votes
4 answers
837 views

Simplified navigation in terminal

I know IDEs are the wave of the future, but I always find myself coding in vim in a Linux terminal. Old dog. New tricks. Anyway, navigation becomes challenging when dealing with long package names. ...
rouble's user avatar
  • 2,001
3 votes
2 answers
1k views

How to create hyphen alias for zsh?

I am using zsh and oh-my-zsh on Ubuntu. To change into the recent directory in the past there was an alias set to - which is the same as cd -. Somehow the alias disappeared at my machine. This might ...
JJD's user avatar
  • 587
3 votes
2 answers
2k views

Can I run a command after the user uses Ctrl-C to kill a command?

So at my position we use a shared set of aliases to do builds. Something like... alias 'build'='cd $BUILD_ROOT; m; cp ...; cp...; deploy; deploy; deploy; cd -' This is super irritating because the ...
Hounshell's user avatar
  • 303
3 votes
3 answers
3k views

How to create bash alias on Ubunth WSL when username has space and apostrophe

I'm trying to create the following alias in Ubuntu WSL: alias windocs='cd /mnt/c/Users/Firstname L'astname/Documents/' My username is unfortunately Firstname L'astname, including the space and ...
Joshua O'Reilly's user avatar
3 votes
2 answers
174 views

How can I create a "base" for other aliases to refer to and enable cd base/x command directories?

I have .bash_aliases with: alias c1='cd /home/me/code/php' alias c2='cd /home/me/code/jquery' alias c3='cd /home/me/code/ruby' alias c4='cd /home/me/code/c' How can I DRY this up and loosen the ...
Michael Durrant's user avatar
3 votes
3 answers
12k views

Create alias for desktop directory

If I type in cd Desktop, no matter what folder the terminal is currently open in, I want it to navigate to /home/bob-ubuntu/Desktop In my .bashrc file I have the following lines at the bottom: alias ...
K Split X's user avatar
  • 1,763

15 30 50 per page