Skip to main content

All Questions

Tagged with
100 votes
7 answers
37k views

How to use `which` on an aliased command?

Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance, alias vim='vim -X' alias grep='grep -E' alias ls='ls -G' The problem is ...
Adrian Petrescu's user avatar
50 votes
5 answers
47k views

Is it possible to include file in config file of zsh? How?

I'd like to have a file eg. f with only zsh aliases (pureness reasons). Then I'd like to include f file in my .zshrc file, so that the aliases defined in f are visible in .zshrc. Is it possible? If ...
xliiv's user avatar
  • 899
40 votes
2 answers
38k views

alias vs export for simple commands

For simple commands like less, is it better to make an alias or to export the options? Is there any benefit of one over the other? For example, if I want less to always use the -R option to show raw ...
skittleys's user avatar
  • 645
37 votes
2 answers
79k views

How to reset a shell environment?

This issue has been bugging me for a while, and although I've thought I've found my answer through EnvWatcher, unfortunately it only works on Bash. And I use zsh. I would like to replicate the things ...
mhitza's user avatar
  • 566
29 votes
3 answers
30k views

Escaping quotes in zsh alias

Following on from this question about stripping newlines out of text, I want to turn this into a zsh alias as follows: alias striplines=' awk " /^$/ {print \"\n\"; } /./ {printf( \" %s \",$0);}"' I'...
Seamus's user avatar
  • 3,703
29 votes
2 answers
4k views

How to make the zsh "correct" functionality remember my spell-correction decisions

I have enabled correction (I wouldn't call it autocorrection specifically because of this issue) in zsh by enabling setopt correct in my .zshrc. Now, when I type dtae in a terminal, I get: dtae ...
shrx's user avatar
  • 445
26 votes
5 answers
14k views

Clear or disable aliases in zsh

I installed oh-my-zsh to make terminal use a bit easier. One thing that bugs me though is the prolific aliases added by it, like "ga", "gap", "gcmsg", "_", which are harder to remember than the ...
Siyuan Ren's user avatar
  • 1,382
25 votes
4 answers
15k views

Share aliases and PATH setting between zsh and bash

The shell that I normally use is zsh. I have several aliases to enable color in some programs such as ls and grep. I've also set my custom path so that I can execute programs in non-standard place (...
phunehehe's user avatar
  • 20.3k
25 votes
1 answer
5k views

how to find file defining an alias

I am having a problem I'm not sure how to get around. Somehwhere on my system, I have an alias defined as such: alias subl=\''/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'\' I ...
Ali Samii's user avatar
  • 441
15 votes
4 answers
13k views

Using zsh autocompletion for alias

I have created a few aliases for git in zsh. For example: gch = git checkout, grb = git rebase --committer-date-is-author-date and some more complex useful zsh functions for git commands. But how can ...
Patrick Artounian's user avatar
14 votes
3 answers
8k views

Resolve all aliases in a zsh command line

I have nested aliases and I want to resolve all of them before executing the command. How do I do that? If there is a function that is not bound to any keys then M-x foobar is fine for me too. I ...
WeSenseASoulInSearchOfAnswers's user avatar
12 votes
5 answers
1k views

How can I "stack" shell aliases?

In my .profile (sourced in sh emulation mode from my .zshrc) I have the following snippet: if [ -f /usr/bin/pacmatic ]; then alias pacman=pacmatic fi # Colorized Pacman output alias pacman="...
strugee's user avatar
  • 15.1k
11 votes
3 answers
6k views

Difference between alias in zsh and alias in bash

I have searched around but could not find anything conclusive. Is there a difference between the alias command in zsh and the alias command in bash? If not, does it mean I can share a set of aliases ...
Zameer Manji's user avatar
11 votes
3 answers
1k views

Defining an alias and immediately use it

In zsh this works fine: alias foo=ls foo But this does not: alias foo=ls; foo Pressing enter an extra time is not an issue when running interactively. But when running through ssh it suddenly ...
Ole Tange's user avatar
  • 35.7k
9 votes
3 answers
6k views

sudo: nocorrect: command not found

I am using zsh and oh-my-zsh on Arch Linux. I am not able to make directory using mkdir edward@ArchLinux ~ $ sudo mkdir -p /samba/raspberry [sudo] password for edward: sudo: nocorrect: command ...
Alex Jones's user avatar
  • 6,383

15 30 50 per page
1
2 3 4 5
8