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.

4 votes
1 answer
932 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
286 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
36 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
80 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
57 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,804
0 votes
1 answer
52 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
85 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
106 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
102 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
65 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
  • 467
0 votes
1 answer
56 views

ksh88 string substitution in alias | mpv streaming [duplicate]

tl;dr how can I substitute a string (i.e. a youtube/streaming url) in an alias such as alias mpvyt='yt-dlp <URL> -o - | mpv - ' ? I live in a mezzanine studio using a M1 macbook for a ...
sylvainsab's user avatar
0 votes
1 answer
163 views

How to show help for some bash command in less (like man do) rather than print it to console

For example, there is no manual pages for trap command. Running: man trap will give: No manual entry for trap Running: trap --help will print help straight to bash console without using less like ...
Anton Samokat's user avatar
1 vote
1 answer
138 views

Converting a tcsh alias into zsh

I had a tcsh alias as follows: alias cdd 'cd `dirname \!*`' I use this to change the directory to the one containing a certain file. For instance, cdd /Users/myself/Document/Folder/File.pdf would ...
leparc's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
60