What command is my alias running? [duplicate]How to use `which` on an aliased command?Why not use “which”? What to use then?In Bash, when to alias, when to script, and when to write a function?How can I test for POSIX compliance of shell scripts?I have a multi-line string that I need to iterate over, but I'm not using bash. Advice?Run one command after another in zsh when Ctrl-C is pressedUnix systems without /dev/stdin, /dev/stdout, and /dev/stderr?~/.bash_aliases vs alias commandWhy alias behave different than running bash command directly?Can't use alias in script, even if I define it just above!Set comparator with variables within a variable, then have shell expand those variables each time it's echo'dHow to use aliases with auto completion in oh-my-zsh?
aging parents with no investments
Some basic questions on halt and move in Turing machines
Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?
I am not able to install anything in ubuntu
"listening to me about as much as you're listening to this pole here"
How many letters suffice to construct words with no repetition?
What happens when a metallic dragon and a chromatic dragon mate?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
What is GPS' 19 year rollover and does it present a cybersecurity issue?
What do the Banks children have against barley water?
I see my dog run
Was there ever an axiom rendered a theorem?
Is there a way to make member function NOT callable from constructor?
New order #4: World
What does "enim et" mean?
Is a car considered movable or immovable property?
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Why doesn't a const reference extend the life of a temporary object passed via a function?
Finding files for which a command fails
Can I find out the caloric content of bread by dehydrating it?
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
Prime joint compound before latex paint?
Is there a familial term for apples and pears?
How to create a consistant feel for character names in a fantasy setting?
What command is my alias running? [duplicate]
How to use `which` on an aliased command?Why not use “which”? What to use then?In Bash, when to alias, when to script, and when to write a function?How can I test for POSIX compliance of shell scripts?I have a multi-line string that I need to iterate over, but I'm not using bash. Advice?Run one command after another in zsh when Ctrl-C is pressedUnix systems without /dev/stdin, /dev/stdout, and /dev/stderr?~/.bash_aliases vs alias commandWhy alias behave different than running bash command directly?Can't use alias in script, even if I define it just above!Set comparator with variables within a variable, then have shell expand those variables each time it's echo'dHow to use aliases with auto completion in oh-my-zsh?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
This question already has an answer here:
How to use `which` on an aliased command?
6 answers
In this question it is recommended repeatedly that to figure out where an executable is located, one should run command -v file.
I've tried running command -v ls on a few different systems now and I keep getting alias ls='ls --color=auto' (always in Bash).
I have three questions:
What am I missing? How is it that
command -v lshelps?Given that
whichdoesn't work properly (according to the comments and answers to the linked question) and assuming that I'm not missing anything in question 1 andcommand -v lsdoes help, how can I know whichlsis actually ran?What is a POSIX compliant way of figuring this out? My examples are in Bash, but I'm hoping for a portable solution. I know about
type -P.
alias posix
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Stephen Kitt, ilkkachu, Jeff Schaller♦ Apr 5 at 21:24
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to use `which` on an aliased command?
6 answers
In this question it is recommended repeatedly that to figure out where an executable is located, one should run command -v file.
I've tried running command -v ls on a few different systems now and I keep getting alias ls='ls --color=auto' (always in Bash).
I have three questions:
What am I missing? How is it that
command -v lshelps?Given that
whichdoesn't work properly (according to the comments and answers to the linked question) and assuming that I'm not missing anything in question 1 andcommand -v lsdoes help, how can I know whichlsis actually ran?What is a POSIX compliant way of figuring this out? My examples are in Bash, but I'm hoping for a portable solution. I know about
type -P.
alias posix
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Stephen Kitt, ilkkachu, Jeff Schaller♦ Apr 5 at 21:24
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06
add a comment |
This question already has an answer here:
How to use `which` on an aliased command?
6 answers
In this question it is recommended repeatedly that to figure out where an executable is located, one should run command -v file.
I've tried running command -v ls on a few different systems now and I keep getting alias ls='ls --color=auto' (always in Bash).
I have three questions:
What am I missing? How is it that
command -v lshelps?Given that
whichdoesn't work properly (according to the comments and answers to the linked question) and assuming that I'm not missing anything in question 1 andcommand -v lsdoes help, how can I know whichlsis actually ran?What is a POSIX compliant way of figuring this out? My examples are in Bash, but I'm hoping for a portable solution. I know about
type -P.
alias posix
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This question already has an answer here:
How to use `which` on an aliased command?
6 answers
In this question it is recommended repeatedly that to figure out where an executable is located, one should run command -v file.
I've tried running command -v ls on a few different systems now and I keep getting alias ls='ls --color=auto' (always in Bash).
I have three questions:
What am I missing? How is it that
command -v lshelps?Given that
whichdoesn't work properly (according to the comments and answers to the linked question) and assuming that I'm not missing anything in question 1 andcommand -v lsdoes help, how can I know whichlsis actually ran?What is a POSIX compliant way of figuring this out? My examples are in Bash, but I'm hoping for a portable solution. I know about
type -P.
This question already has an answer here:
How to use `which` on an aliased command?
6 answers
alias posix
alias posix
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Apr 5 at 16:05
alias
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Apr 5 at 16:00
aliasalias
205
205
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Stephen Kitt, ilkkachu, Jeff Schaller♦ Apr 5 at 21:24
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Stephen Kitt, ilkkachu, Jeff Schaller♦ Apr 5 at 21:24
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06
add a comment |
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06
add a comment |
1 Answer
1
active
oldest
votes
I believe I've found an answer to all three questions. It's pretty obvious once you see it, but it wasn't obvious for me at all, hence the question.
- Remove alias
- Run
command -v. (See POSIX on this). - Realias if that is one's wish.
For a specific example for those who might not know exactly how to do this, below I apply this process to ls.
$ command -v ls
alias ls='ls --color=auto'
$ unalias ls # Step 1 above
$ command -v ls # Step 2 above
/bin/ls
$ alias ls='ls --color=auto' # Step 3 above
$ command -v ls
alias ls='ls --color=auto'
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
aka unix.stackexchange.com/a/10532/117549:( unalias vim; type vim )
– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe I've found an answer to all three questions. It's pretty obvious once you see it, but it wasn't obvious for me at all, hence the question.
- Remove alias
- Run
command -v. (See POSIX on this). - Realias if that is one's wish.
For a specific example for those who might not know exactly how to do this, below I apply this process to ls.
$ command -v ls
alias ls='ls --color=auto'
$ unalias ls # Step 1 above
$ command -v ls # Step 2 above
/bin/ls
$ alias ls='ls --color=auto' # Step 3 above
$ command -v ls
alias ls='ls --color=auto'
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
aka unix.stackexchange.com/a/10532/117549:( unalias vim; type vim )
– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
add a comment |
I believe I've found an answer to all three questions. It's pretty obvious once you see it, but it wasn't obvious for me at all, hence the question.
- Remove alias
- Run
command -v. (See POSIX on this). - Realias if that is one's wish.
For a specific example for those who might not know exactly how to do this, below I apply this process to ls.
$ command -v ls
alias ls='ls --color=auto'
$ unalias ls # Step 1 above
$ command -v ls # Step 2 above
/bin/ls
$ alias ls='ls --color=auto' # Step 3 above
$ command -v ls
alias ls='ls --color=auto'
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
aka unix.stackexchange.com/a/10532/117549:( unalias vim; type vim )
– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
add a comment |
I believe I've found an answer to all three questions. It's pretty obvious once you see it, but it wasn't obvious for me at all, hence the question.
- Remove alias
- Run
command -v. (See POSIX on this). - Realias if that is one's wish.
For a specific example for those who might not know exactly how to do this, below I apply this process to ls.
$ command -v ls
alias ls='ls --color=auto'
$ unalias ls # Step 1 above
$ command -v ls # Step 2 above
/bin/ls
$ alias ls='ls --color=auto' # Step 3 above
$ command -v ls
alias ls='ls --color=auto'
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I believe I've found an answer to all three questions. It's pretty obvious once you see it, but it wasn't obvious for me at all, hence the question.
- Remove alias
- Run
command -v. (See POSIX on this). - Realias if that is one's wish.
For a specific example for those who might not know exactly how to do this, below I apply this process to ls.
$ command -v ls
alias ls='ls --color=auto'
$ unalias ls # Step 1 above
$ command -v ls # Step 2 above
/bin/ls
$ alias ls='ls --color=auto' # Step 3 above
$ command -v ls
alias ls='ls --color=auto'
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Apr 5 at 16:26
aliasalias
205
205
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
alias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
aka unix.stackexchange.com/a/10532/117549:( unalias vim; type vim )
– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
add a comment |
1
aka unix.stackexchange.com/a/10532/117549:( unalias vim; type vim )
– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
1
1
aka unix.stackexchange.com/a/10532/117549:
( unalias vim; type vim )– Jeff Schaller♦
Apr 5 at 17:02
aka unix.stackexchange.com/a/10532/117549:
( unalias vim; type vim )– Jeff Schaller♦
Apr 5 at 17:02
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller I don't feel, but could feel humiliated. At least now I know :)
– alias
Apr 5 at 17:55
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
@JeffSchaller Would you turn that into an answer? I'm an unregistered user in an incognito window and I'm unable to accept my answer for two more days. If no one gives an answer I can accept, this is going to stay unaccepted.
– alias
Apr 5 at 20:48
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
If that feels like an Answer to you, then I think the right thing to do is to close this Q as a duplicate of the other.
– Jeff Schaller♦
Apr 5 at 21:15
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
@JeffSchaller Is this something I can do? I don't see any button like I sometimes do.
– alias
Apr 5 at 21:18
add a comment |
@JeffSchaller I can't find the answer to 1. or 3. in there.
– alias
Apr 5 at 16:06
@StephenKitt Please read my comment above.
– alias
Apr 5 at 16:06