Skip to main content

All Questions

Tagged with
1 vote
2 answers
389 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
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
301 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
1 vote
1 answer
170 views

How to send output to next input line?

This my snippet alias hst="history 1 -1 | cut -c 8- | uniq | fzf ". when I run hst The output is $ ~ hst (the output from hst) $ This is what I want $ ~ hst $ (the output from hst) Example ...
Jamm Utkarsh's user avatar
0 votes
2 answers
150 views

How to get 'man gfind' when I enter 'man find'?

On my new-ish mac os/Darwin system, my find tool is an 11-year-old BSD version. I have used MacPorts to install a more current version: GNU's find, which MacPorts has named gfind, and placed in /opt/...
Seamus's user avatar
  • 3,062
0 votes
1 answer
193 views

Usig zsh glob variable not expanding inside alias

I want to list and sort by time, all the files matching a certain pattern and then get only the first 20: ls -laths *.txt | head -20 This works well, for example if I create two files: touch 1.txt ...
Santiago's user avatar
  • 418
1 vote
0 answers
791 views

When does /usr/share/zsh/vendor-completions get loaded?

As far as I can tell, my .zshrc doesn't manually source anything in /usr/share/zsh/vendor-completions. If I try to write, in my .zshrc, an alias for a command that has completions set up in /usr/share/...
2rs2ts's user avatar
  • 163
1 vote
0 answers
21 views

Unable to iterate over files using ZSH alias [duplicate]

I have simple command to iterate JPG files for f in *.JPG;do echo "Processing $f";done The terminal output is as follows: Processing IMG_0316.JPG Processing IMG_0317.JPG Processing IMG_0318....
xssknix's user avatar
  • 11
0 votes
1 answer
63 views

How can I know which are my most used aliases?

I would like to know which aliases I use most often, in both zsh and vim, so I can rename them to have more or fewer letters depending on the use. And also to remove aliases I never use, because I ...
user avatar
1 vote
1 answer
757 views

How can I get aliases and functions descriptions?

I use oh-my-zsh and I have many aliases and functions I can't remember, so I use alias ag="alias | grep" to find out what an alias does. I also use alias-tips. But instead of getting the ...
user avatar
4 votes
3 answers
2k views

Automatically source a file when `cd` into a specific directory

I have couple of utility commands-and-aliases that are generic enough in any directory for my own requirement. But there are certain directory e.g. 'build', where I need a custom behaviour. To do this,...
mtk's user avatar
  • 27.8k
9 votes
1 answer
6k views

How to overwrite aliases in my shell (Oh My Zsh)?

I would like to alias my ls command, but there is a previously defined alias for it which I believe gets invoked first before my definition! I am using .zshrc to define my alias, and here is what I ...
Farhad's user avatar
  • 93
0 votes
1 answer
501 views

zsh alias not being unaliased in zshrc

[leading dots elided because I don't want to type them] An alias--gl--is set to git pull by a plugin in my zshrc. I want to set it to a git log command. I'm on macOS and, as expected, /etc/zshrc is ...
meangrape's user avatar
  • 136
2 votes
2 answers
400 views

create an alias on ZSH but need to type it twice

I'm trying to create an alias on ZSH. The aim of the alias is to activate a python virtualenv. I've put a line in my .zshrc alias SOU="source /home/andykw/.zshrc && source $(setopt ...
Andy K's user avatar
  • 179

15 30 50 per page
1
2
3 4 5
8