Questions tagged [alias]

In shells, an alias is an alternate name for a command. For instance, "ll" is an alias for "ls -l" on many systems.

In shells, an alias is an alternate name for a command. For instance, "ll" is an alias for "ls -l" on many systems.

414 questions
582
votes
6 answers

How to see the command attached to a bash alias?

Suppose I have an alias in the bash shell. Is there a simple command to print out what command the alias will run?
Casebash
  • 6,079
566
votes
10 answers

How do I create a permanent Bash alias?

I would like to create an alias to rm command in order to have a confirmation message after executing this command. So I am creating an alias like this alias rm='rm -i' . But as far as I know this is a temporary alias and it lives until you close…
Bakhtiyor
  • 12,884
403
votes
3 answers

How do I remove an alias?

I want to remove the gs alias from my PC. When I type gs it opens GhostScript. But I checked everywhere in the home directory .alias , .bash_aliases , and .bashrc . I also overwrote gs with my custom alias. I can't remove it. I've also typed alias…
jean000
  • 4,139
247
votes
8 answers

Aliases not available when using sudo

I was playing around with aliases today and I noticed that aliases don't seem to be available whilst using sudo : danny@kaon:~$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l='ls -CF'…
kemra102
  • 2,986
216
votes
11 answers

How to run an alias in a shell script?

I have an executable file mpiexec , whose full path is ~/petsc-3.2-p6/petsc-arch/bin/mpiexec . Since I want to execute this command in different directories (without having to retype the entire path), I setup an alias in my home .bashrc file: alias…
Paul
  • 2,399
120
votes
6 answers

Bypass the yes/no prompt in 'apt-get upgrade'

In order avoid typing out all of the apt-get commands when updating my computer I have made a simple alias command to do it. But I really want to be able to just type in my alias and let it do its thing and not have to wait to for the yes/no prompt…
Ntc
  • 1,414
99
votes
1 answer

How to make a permanent alias in oh-my-zsh?

In my .zshrc I tried to make a few aliases .I looked into a lot of places, but I couldn't find out a way that worked. I used this code below: # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be…
78
votes
4 answers

How can I preset aliases for all users?

I have Ubuntu 14.04.2. I want to make it so all users automatically have a specific set of aliases. I have my aliases set in my personal .bashrc, but I don't want to have to manually copy them into the other users. Ideally it should automatically…
Brian Sizemore
  • 1,373
  • 3
  • 11
  • 19
57
votes
5 answers

What command is the alias ll for?

Can someone tell me what terminal command the alias ll is for? All I can find online is many people saying that it is an alias for ls -l or ls -la or ls -ltr . But that's simply wrong. The result looks different. Is there any way to locate ll and…
Socrates
  • 2,665
53
votes
8 answers

How to add an alias to a command in terminal?

By typing a manually specified command in terminal I want to execute some other command. How could add an alias to a command? Can i do that with the help of the terminal or should I edit some kind of file?
Rootical V.
  • 1,175
52
votes
3 answers

Is there a way to echo an alias?

I have set some aliases in my .bashrc file and for some reason one of them does not behave as expected. Since I don't remember the exact command assigned to that alias, I would like to see the command to find out what's wrong. Except the obvious…
ppp
  • 866
51
votes
4 answers

Can I pass arguments to an alias command?

I want to know if I can pass an argument with an alias command. for example: alias d="dmesg | grep -iw usb | tail -5" Now d will print the last 5 lines. If I want to use d to print a different number of lines, I have to make change in the alias…
srk_cb
  • 1,447
37
votes
6 answers

How can I create an alias for cd and ls?

I frequently run the ls command after running the cd command. How can I create an alias (like cs ) for this operation?
dv3500ea
  • 37,754
36
votes
5 answers

How can I run the original command that I also have aliased with same name?

I have an alias for the ls command in my ~/.bashrc file aliased with this one: alias ls='ls --color=auto' When I run the ls command in a terminal, the aliased ls ( ls --color=auto ) runs. My question is: how can I run the original ls only (not the…
αғsнιη
  • 36,400
31
votes
2 answers

Understanding .bashrc and .bash_profile

On a server when I login as root I see .bashrc (Ubuntu 10.10). On my Mac I have a .bash_profile Does Ubuntu always have only a .bashrc file and not .bash_profile ? (I'm just confused, so asking, I realize they are different o/s's but maybe there is…
Blankman
  • 8,645
1
2 3
27 28