All Questions
Tagged with alias cd-command
25
questions
2
votes
2
answers
956
views
Why do I have to use this command twice to execute it?
I made an alias alias goto="cd $@ && source ~/.zshrc" and it works, but only if I execute it twice. Even after I execute it twice in one shell, and if I want to move to another dir, ...
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
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=...
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 -...
0
votes
1
answer
51
views
Alias CD to a directory that's name is included in current directory
I've been using cmake and creating a build folder for my cmake code and I want to easily cd to the build directory. I've been naming my build directory in this format:
/parent/codeandsuch
/parent/...
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 ...
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 ...
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 ...
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 ...
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 "$(...
0
votes
2
answers
333
views
why does /var/mail/{username} = /Users/{username}?
My basic question is why do both of these paths point to home (i.e., ~)? Is it pointing to the same home or is it duplicated?
I doubt it's duplicated, so if not, how does cd .. decide which directory ...
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/...
2
votes
1
answer
1k
views
ls after cd in tcsh?
I cannot seem to find an answer to this question. In my .bash_profile I have this line:
cd() { builtin cd "$@"; ll; }
which executes ll every time I change directories. I would like this ...
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 ...
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 ...