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.

402 questions
538
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
  • 5,639
  • 4
  • 18
  • 16
518
votes
11 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 the…
Bakhtiyor
  • 12,124
  • 25
  • 65
  • 81
369
votes
3 answers

How do I remove an alias?

I want to remove gs alias from my PC. When I type gs it will open GhostScript. But I checked everywhere in the home directory .alias .bash_aliases .bashrc I also overwrite the gs with my custom alias. I can't remove it. And I also type alias in…
jean000
  • 3,799
  • 2
  • 13
  • 3
228
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…
kemra102
  • 2,796
  • 4
  • 19
  • 15
186
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,099
  • 5
  • 17
  • 14
108
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,294
  • 3
  • 10
  • 10
92
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…
Shamveel Ahammed
  • 1,023
  • 1
  • 7
  • 4
71
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,263
  • 2
  • 10
  • 18
51
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,351
  • 7
  • 31
  • 52
50
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,105
  • 2
  • 11
  • 12
49
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
  • 836
  • 3
  • 11
  • 17
38
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,267
  • 2
  • 12
  • 14
34
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
  • 36,816
  • 13
  • 99
  • 152
32
votes
5 answers

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

An alias for ls command in ~/.bashrc file aliased with this one: alias ls='ls --color=auto' then, when I run ls command in terminal aliased ls(ls --color=auto) runs. but my question is how can I run original ls only and only ls alone without extra…
αғsнιη
  • 35,092
  • 41
  • 129
  • 192
30
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 a…
Blankman
  • 8,095
  • 14
  • 38
  • 39
1
2 3
26 27