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.

0 votes
1 answer
34 views

Get a list of all user's commands from a non-interactive shell

I am writing a script that would automatically suggest some new aliases/functions to be added to a user's shell config. Before doing that, however, I would like to make sure the aliases being ...
zoickx's user avatar
  • 51
0 votes
1 answer
40 views

zsh alias does not complete fully if not sourced once a day

vi ~/.zsh alias k='kubectl' complete -o default -F __start_kubectl k alias kga='k get all,ingress' If I do not source .zsh every day it does not take into account the ingress part of the kga alias. ...
dfs's user avatar
  • 1
0 votes
2 answers
79 views

How to write an alias or bash script that renames a single file using the same syntax as the `ren` command of Windows?

I am a long-term a Windows user, so I find the syntax of the ren command both simple and convenient: ren C:\pathTo\myFile\oldFileName.txt newFileName.txt I want to be able to use the same syntax on ...
ps.pf's user avatar
  • 3
4 votes
1 answer
997 views

Are there alternatives to alias I'm not aware of?

Today I started to notice weird behavior running a local command for a binary installed through Go. It seems the command is aliased, but consulting alias, it isn't. The command buf somehow executes cp!...
Tim's user avatar
  • 1,054
3 votes
2 answers
296 views

how to alias the `history` function in fish shell

I'm trying to set the fish history pager to be bat -l fish for syntax highlighting. (i.e. set the PAGER environment variable bat -l fish just for the history command). I tried: # 1: alias history &...
matan h's user avatar
  • 147
0 votes
2 answers
37 views

How to escape both single quotes and exclamation marks in bash

I have a long command and I just want to use alias to shorten it. But the command contains single quotes and exclamation marks. The origin command is ldapsearch -x -H ... -w 'abc!123'. I tried alias ...
Donghua Liu's user avatar
2 votes
0 answers
45 views

Can't unalias then redefine as a function in the same conditional [duplicate]

Here is a simplified implementation of an issue in my bash/zsh aliases file: alias foobar='echo bar' # this is out of my control if true; then unalias foobar echo we got inside the conditional ...
Adam Katz's user avatar
  • 4,012
0 votes
2 answers
83 views

Is it possible to use a command with an argument to trigger a bash alias?

I have a program that tries to trigger a screenlock using the following commands: xdg-screensaver lock xscreensaver -lock cinnamon-screensaver-command --lock The problem is that I'm using ...
guttermonk's user avatar
0 votes
1 answer
76 views

Zsh zinit load OhMyZsh plugin skipping aliases

I want to use these plugins using zinit to load git completions in zsh zinit wait lucid for \ OMZL::git.zsh \ OMZP::git But I don't care about the aliases, there are really too much aliases I ...
fchastanet's user avatar
0 votes
1 answer
57 views

Is there a way I can use .bash_aliases in a shell-scripts? [duplicate]

Is there a way I can use bash aliases from my .bash_aliases file within a shell-scripts? I thought of something like including source "$HOME/.bash_aliases into my script but it does not work.
nath's user avatar
  • 5,824
0 votes
1 answer
54 views

How can I call git's built-in diff command directly after configuring a different visual "git diff" substitute?

I have configured git diff to be a command that calls substitute diff for viewing file differences i.e /usr/bin/vim -dR "$2" "$3" and that doesn't work when I want to create a ...
vfclists's user avatar
  • 7,619
0 votes
1 answer
92 views

Can I reprogram the pwd command to add a trailing slash?

WHen I use the pwd command, it prints e.g /opt instead of /opt/. I would like it to print the trailing slash. However, I tried adding the following line to my ~/.bash_aliases file: alias pwd=" ...
K.defaoite's user avatar
1 vote
2 answers
124 views

alias defined in .zshrc does not propagate to shell script

I have python installed on my system as python3. In my .zshrc file I defined following alias: alias python=python3 With this, I am able to run python3 using python on the command-line: $ python ...
morpheus's user avatar
  • 115
1 vote
1 answer
109 views

How can I remove aliases "which-command=whence" and "run-help=man"?

I'm running Artix Linux and using zsh, and these two aliases return no matter how many times I unalias them or remove them from my aliasrc: run-help=man which-command=whence And they don't exist in ...
swishkin's user avatar
0 votes
1 answer
68 views

Can i used these aliases in some sort of config file?

I have many of these kinds of aliases, the part before = is the host in ssh config alias sshConfigHost='ssh -t hostname docker exec -it containerName bash' Could I add these to some sort of config ...
Nickotine's user avatar
  • 489

15 30 50 per page
1
2 3 4 5
61