All Questions
115
questions
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
...
0
votes
1
answer
65
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 ...
1
vote
2
answers
109
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
...
1
vote
1
answer
105
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 ...
1
vote
1
answer
140
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 ...
0
votes
1
answer
233
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: ...
2
votes
1
answer
74
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. ...
0
votes
1
answer
440
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 ...
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, \"...
1
vote
1
answer
267
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 ...
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 ...
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 ...
1
vote
2
answers
247
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 $...
0
votes
1
answer
315
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=$...
1
vote
2
answers
907
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. ...