Skip to main content

All Questions

Tagged with
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
1 answer
61 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
1 vote
2 answers
108 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
104 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
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
0 votes
1 answer
231 views

zsh: alias'd commands stop working

This keeps happening and I'm not sure why. How do I trace what zsh is actually trying to do, and why it starts ignoring my alias? ************@*******-MacBook-Pro$ reload zsh: command not found: ...
Harv's user avatar
  • 2,144
2 votes
1 answer
73 views

Alias + and - in zsh?

For years I've used + and - as aliases for pushd and popd in both csh and bash. I've finally given up on my Macs and want to switch to zsh but I haven't been able to find a way to make these aliases. ...
sfjac's user avatar
  • 123
0 votes
1 answer
439 views

How to list only the aliases defined by the user?

I'm using the ZSH and defined some aliases (stored in multiple fines, that are loaded in the ~/.zshrc). That is working fine. Executing the command alias allows to list all available aliases. Now I'd ...
automatix's user avatar
  • 219
2 votes
1 answer
356 views

Alias piping into awk

I am trying to create an ll with awk pipe alias. I am trying to escape the apostrophes using the following answers. alias lh= `ll -h | awk {'print $9, \"-\" ,$5, \"-\", $8, \"...
zerberus's user avatar
1 vote
1 answer
266 views

How to write a function that takes an argument string that does not need to be quoted?

I'm writing a function, adding it to ~/.zshrc on my Mac. It's in order to more quickly handle commands to youtube-dl. I have this: function dlv() { cd /Users/admin/Downloads youtube-dl ...
Alfie Stoppani's user avatar
1 vote
0 answers
115 views

can we trigger some action if we `cd` into directory? [duplicate]

I have multiple projects over various languages like JavaScript, Python. I wonder if Linux provides some functionality to trigger some actions automatically if we cd into a particular directory? For ...
Visrut's user avatar
  • 137
1 vote
2 answers
1k views

/etc/zshrc is not applied when log in

I have no idea why having aliases that are applied to all interactive terminal (i.e., my user account and sudo) is so difficult. Most web search result were about BASH, but my shell is ZSH (Manjaro ...
Damn Vegetables's user avatar
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
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

15 30 50 per page
1
2 3 4 5
8