Skip to main content

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.

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, ...
BrassPandaSax's user avatar
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 ...
eapo's user avatar
  • 121
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 $...
user avatar
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&...
gary's user avatar
  • 23
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 ...
Mickael Evrard's user avatar
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=$...
amstergc20's user avatar
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. ...
Daniel Kaplan's user avatar
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 &...
HippoMan's user avatar
  • 647
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 ...
a11's user avatar
  • 103
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 ...
pahohu's user avatar
  • 111
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 ...
ShifraSec's user avatar
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=...
Ramita's user avatar
  • 11
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,...
einpoklum's user avatar
  • 9,636
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
genggi's user avatar
  • 1
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....
Lord of the Goo's user avatar

15 30 50 per page
1
3 4
5
6 7
61