Questions tagged [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 at the command-line and avoid having to remember complex combinations of commands and options.
926 questions
0 votes
1 answer
116 views
How to wrap source command in tcsh
I need a solution only for tcsh. Say I have a source file that sources other files which in their turn can source other files. My goal is to track which files were eventually sourced. One way I can do ...
0 votes
2 answers
177 views
How to prevent side effects when using an alias (e.g. cat aliased to batcat)?
I want to alias cat to batcat. Yet I do not want to break any script on my system that may depend on cat. How to ensure that it won't break existing scripts? I am on an Ubuntu machine on a bash ...
1 vote
2 answers
139 views
How can I temporarily bypass an alias of a keyword in Bash?
If I alias a keyword, I can't figure out how to bypass it. $ alias if='echo "GOTCHA!"; if' $ if true; then echo y; fi GOTCHA! y The usual tools for bypassing an alias, like escaping, ...
0 votes
1 answer
134 views
Unavailable executable still remains
Please note: This is not a question related to pip or python. I am trying to make sense of why I see a "permission error" instead of "path not found" error. I have done many ...
-1 votes
2 answers
185 views
Unable to Execute Multiple Alias Commands Simultaneously
I'm encountering an issue where I'm unable to execute multiple alias commands at the same time in my shell environment. For example, when I try to run two alias commands together, only one seems to ...
-1 votes
1 answer
114 views
Why doesn't bash recognize alias in interactive mode?
How is this possible? styx@LouSTyx:…$ GCOM "\pushdict now ignores prefix macro." GCOM : commande introuvable styx@LouSTyx:…$ type GCOM GCOM est un alias vers « git commit -a -m »
0 votes
1 answer
79 views
Alias for rm does not include file name with @$ [duplicate]
I am trying to create an alias for the rm command in the /root/.bashrc file on a VirtualBox Redhat VM (running RHEL 9). I cannot get it to work properly. This is an excerpt of my .bashrc file: alias ...
1 vote
1 answer
134 views
Bash profile seems not to be loaded when -c option is present
There are a fair bit of similar questions, but I can't find spec for this particular case. I'm writing a shell script to verify bash configuration. For exmaple, I add test_alias to ~/.bashrc, which is ...
0 votes
2 answers
191 views
In a bash alias, how do I run "apt autoremove" automatically after "apt upgrade" only if needed?
I have two alias in my Debian's .bashrc: alias upd='sudo apt update && apt list --upgradable' alias upg='sudo apt upgrade' Then I use upd to update and display all upgradable packages, and ...
1 vote
1 answer
125 views
How to define a recursive alias in csh (intentionally!)
It is known that attempting to invoke a custom alias inside itself (be it directly; or indirectly via intermediate aliases that call each other) would cause an "Alias loop." error, and ...
0 votes
2 answers
166 views
How to expand a Bash alias given as an argument?
I probably approach this problem wrong. I update my Linux machines with bash aliases like: alias upg-pi='\ssh -c [email protected] -C -i $ssh_identity -o ConnectTimeout=$ssh_timeout root@$...
5 votes
3 answers
1k views
'which' vs. 'type -a'
There is a 2022 article by a guy who is a senior developer, and there he has the following alias in his zsh config: alias which='type -a' But zsh has which by default, and if we use this which like ...
-1 votes
1 answer
95 views
zsh alias causes error if used in fish
I have the following aliases in my zsh: alias -- -='cd -' alias ..='cd ..' alias ...='cd ../..' When I switch to fish, by manually typing fish and pressing Return, the first alias causes an error: - (...
0 votes
2 answers
212 views
append newline to bash alias
Im finding great difficulty in adding a new line character to my bash alias in my ~/.bashrc file alias mip="curl ifconfig.me/ip" I want a newline to be inserted after the above script, so ...
0 votes
1 answer
162 views
Inheriting path modifications vs. Inheriting aliases
My login shell is zsh. I have added the following two lines to my .zprofile file: path+=$HOME/foobar123 alias foo='echo bar' Then, if I switch to bash or fish, by typing bash or fish and pressing ...