Questions tagged [bash-alias]
An alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. This can save a great deal of typing in the command-line and avoid having to remember complex combinations of commands and options. Use this tag for questions about using aliases with the bash shell.
82
questions
1
vote
1
answer
63
views
merge numbered files from different directories into same directory in correct order
I have some directories named FOO and BAR and etc. that have files in form
FOO/
1.png
...
18.png
BAR/
1.jpg
...
12.jpg
...
and I would like them to be all copied into the DESTINATION directory ...
1
vote
1
answer
1k
views
The most proper place to set systemwide shell alias in a Linux system
There are many places to set an alias for all users within a Linux system,
e.g. /etc/profile, /etc/profile.d/*, /etc/bash.bashrc...
I'm wondering which one is the most proper/correct, in other words, ...
0
votes
0
answers
151
views
Configure zsh syntax highlighting for bash-my-aws
I have been using zsh syntax highlighter from this repo and it has been very great so far. Now, I discovered a repo called bash-my-aws which aliases my awscli commands to a more usable and compact ...
1
vote
1
answer
574
views
Expand variable to alias and execute
I have an alias set in my .bash_aliases file to execute neovim.
I can successfully use this alias from the command line however I cannot use this alias via a variable (ie the EDITOR variable - set in ....
1
vote
1
answer
207
views
How do I make a Subshell a part of an alias?
I'm not sure what is the correct way to describe my problem, so here's an example:
alias ashell='adb shell su $(stat -c %u /data/data/com.termux) -s /data/data/com.termux/files/home/bin/termuxshell'
...
-1
votes
1
answer
1k
views
making it so alias's work in shell scripts?
So I don't have python available as a command on my system but I do have python3. So I did alias python=python3 and I was able to then do python test.py insead of just python3 test.py.
I then created ...
0
votes
1
answer
270
views
How can I make a bash script alias that accepts inputs?
I currently have a bash script that starts up a python file like so
#!/bin/bash
echo "Starting main.py in Production folder"
cd Production
python main.py
main.py is actually supposed to ...
1
vote
2
answers
658
views
How to have bash aliases usable from any directory?
As title sais I want to be able to use bash aliases from inside directories other than home. If file structure looks something like /home/Documents, do I have to create another .bash_aliases folder ...
1
vote
1
answer
418
views
Git Bash : neither .bash_aliases nor .gitconfig read automatically
I'm setting up a new computer, and, among other things, Git with Git Bash. I copied my .bash_aliases and .gitconfig from a previous computer, but I can't get Git Bash to source them automatically.
...
0
votes
1
answer
1k
views
Aliases for going to directory of a file and executing command in that directory
I am trying to write two command aliases one to take a file not directory path and cd into its directory. My attempt below is.
alias godir='cd $(dirname $1)'
however this leads to
bash cd: {file path}...
0
votes
2
answers
49
views
Bash recognizes function argument as a program
I'm pretty new to the syntax of bash and I have a piece of code in my '.bash_aliases' file. It either gets an integer as an argument or the letter 'c', when it gets an integer, it puts that integer in ...
8
votes
1
answer
4k
views
How to use alias inside another alias in ZSH?
Let's say I have the following alias definition in my ZSH config file:
alias myalias="cd /"
how can I use myalias inside another alias? ie:
alias myaliasone="myalias && cd /usr&...
0
votes
1
answer
36
views
Can no longer open terminal after editing my bash_aliases
I edited my bash_aliases to have a new alias (stars block out my email for privacy sake):
alias t_cluster="u*******@notchpeak.chpc.utah.edu"
I then mistakenly added this to my bash_aliases (...
1
vote
2
answers
369
views
Why fish shell does not allow function named `-`
I am trying to use fish as my default interactive shell. I was previously using bash and there was support for alias named - (ASCII hyphen, 0x2d). Why does not fish allow creation of alias or function ...
1
vote
0
answers
888
views
How to escape slashes in bash alias name?
I want to make an alias like this:
alias /sbin/init="/path/to/my/script/sh"
However, when I try to source my .bashrc, it throws an error:
-bash: alias: `/sbin/init': invalid alias name
How ...