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.
901
questions
1
vote
1
answer
68
views
Why does enclosing a command in double quotes affect aliases?
I have an alias rm='/bin/rm -i' and I know that if I type "rm" filename in the command line, the alias will be ignored somehow and the normal rm command without the -i flag will be called, ...
1
vote
0
answers
274
views
Minify bash command with arguments
Want to minify bash command using arguments.
I am often checking the internet provider's and other Free and Public DNS Servers with the code below running in tmux, but wondering, how this can be ...
1
vote
2
answers
243
views
Kill all processes macthing a pattern, ignoring case
I want to have an alias to do something like pkill -f PATTERN but ignoring the case of the pattern. This is what I have after looking around but it's not working
alias pkf="kill `ps ax | grep -i $...
2
votes
1
answer
136
views
How to create alias with a caret^ command?
I have a workflow that first check git diff for specific file and then add it to stage.
git diff ..
^diff^add
I want to give these command a alias but this one doesn't work
alias da="^diff^add&...
0
votes
1
answer
236
views
Ubuntu - Run executable with customized name from anywhere
I have installed etcher and I can run it from its installation directory (.../balena-etcher-electron-1.7.9-linux-x64/squashfs-root) with the command ./balena-etcher-electron. Well wonderful !
But now ...
0
votes
1
answer
313
views
Add heredoc (<<) to end of alias within function call
I have an alias which is my psql connection string for a database, let's say the alias is this:
alias GQQ='psql "host=$host user=$redshift_uname dbname=$redshift_dbname port=$port pass word=$...
1
vote
2
answers
900
views
How can I/Should I default flags when running a command?
For context, I'm using zsh. Every time I use locate, I want to pass the -i and -A flags.
Usually, if I can get away with it, I create an alias with the same name as the existing command to do this. ...
1
vote
2
answers
388
views
zsh: alias or shell function to only echo its command line, including shell control characters
Using zsh, I'd like to create an alias or a shell function that operates as follows:
I want this alias or shell function to echo its command line without honoring any shell control characters such as &...
0
votes
1
answer
57
views
Bash set project-specific aliases, file not found
I am on Windows and using GitBash to run shell scripts in bash that run python scripts.
How can I create a project-specific alias to define a specific python environment and run shell scripts through ...
1
vote
1
answer
157
views
How not to use nested strong quotes (')
I'm a relatively new user of zsh and don't know too much about shells (unfortunately). Nonetheless, I would like to define an alias in my .bashrc containing a hash. However, zsh doesn't seem to like ...
0
votes
0
answers
300
views
Custom alias outside .zshrc but ZSH_CUSTOM doesn't work in kali
For reference this is not a duplicate: I reviewed other Q and A like this but it doesn't work for me.
Background:
I'm using Kali in parallels.
To keep my .zshrc file tidy I decided to mkdir ...
1
vote
3
answers
3k
views
How do I make an alias for a command with sudo
I want to add two aliases, so one executes a command when non sudo, and the other executes a command when sudo, like this:
alias v = 'nvim'
alias 'sudo v' = 'sudo -E nvim '
I also have set alias sudo=...
2
votes
0
answers
89
views
"Could not find foo in PATH" - but it's right there
I see the following behavior:
$ foo
Could not find foo in PATH
$ which foo
/usr/local/corp/bin/foo
$ readlink -f `which foo`
/path/to/opt/foo/foo
$ /usr/local/corp/bin/foo
starting foo, output for foo,...
0
votes
1
answer
61
views
How do I exactly alias this one liner in bash?
bash alias doesn't like the quotes
dpkg-query -W -f '${Installed-Size;8}kb ${Package} ${Version} ${Status}\n' | sort -n | column -t | grep -Pv "(lib*)" | fzf
1
vote
1
answer
263
views
fish shell: universal variables and alias not shared between "contexts"
I use fish shell mainly from Rider IDE and iTerm2.
I've noticed that every task that implies saving something for future sessions will not operate transparently between the two aforementioned contexts....