All Questions
13 questions
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 ...
1
vote
1
answer
3k
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=...
3
votes
3
answers
13k
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 ...
36
votes
4
answers
67k
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 ...
2
votes
1
answer
55
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 ...
2
votes
2
answers
3k
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 ...
1
vote
1
answer
4k
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 "$(...
8
votes
2
answers
26k
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 ...
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 ...
4
votes
4
answers
849
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. ...
3
votes
2
answers
176
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 ...
134
votes
36
answers
74k
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]/...
21
votes
2
answers
12k
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 ...