Skip to main content

All Questions

Tagged with
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
1 vote
1 answer
2k views

Shell Script To CD and Run a Python Script

OK, I know that there is a lot like this question but I literally get nothing. The thing i need is a script that cd's to /home/project then runs python3 pyscript.py I created an alias to cd alias name=...
akkaygin'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
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
2 votes
1 answer
52 views

Create shorcuts in a terminal to navigate between folders [duplicate]

I am looking a way to create shortcuts for the cd command. My goal is to go quickly to distant folders. I have a new (big) drive which is not in my /home folder (but in /media/user/xxX/yyy/) and I ...
ppr's user avatar
  • 1,917
2 votes
2 answers
2k views

How to define alias only for some directory? [duplicate]

I want to define some alias iex="iex -S mix" only for one directory - this alias should work only when I cd'ed to this directory. Another requirement - this functionality should be placed inside this ...
Alex Antonov's user avatar
1 vote
1 answer
3k views

alias to make a new directory and go to it [duplicate]

So here I've created, or at least tried to create an alias for a command that accepts a command-line argument, makes a new directory with that name, and goes to it. alias newfolder='mkdir $2 ; cd "$(...
Galaxy's user avatar
  • 505
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
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
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
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
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
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