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

learn more… | top users | synonyms

62
votes
6answers
111k views

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 ...
11
votes
6answers
14k views

How to add an alias to a command in terminal?

By typing a manually specified command in terminal i want to do some. 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?
21
votes
6answers
7k views

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?
35
votes
2answers
9k views

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' ...
20
votes
4answers
13k views

How save my “alias” entries forever [duplicate]

I want to save my alias commands forever like the default ones when I type "alias" so I don't retype them every time I leave my bash
4
votes
1answer
2k views

Aliases don't work after restart terminal

I have create few new aliases in ~/.bashrc then run source ~/.bashrc and it worked. But after restart terminal it does not work. I looked back and found the advice: create ~/.bash_aliases and in ...
5
votes
2answers
5k views

How to protecting cd command to deal with parentheses?

I asked here how to make cd protect spaces. Tab completion is great, but sometimes you paste the path from the clipboard so this is useful. The solution breaks with parentheses however. No matter how ...
3
votes
1answer
3k views

Ubuntu alias not applied in bashrc

I am under Ubuntu 12.04 LTS. I have added such line to ~/.bashrc alias myconf="sudo nano /opt/nginx/conf/sites-available/efiling" I tried with single quotes too: alias myconf='sudo nano ...
15
votes
3answers
356 views

My .bashrc alias not run in .desktop file

I've added the following line to the .bashrc file: alias midos="sh /home/erkanmdr/Belgeler/midos/midos.sh" This command works fine in the terminal and tty. But not working in my .desktop shortcut ...
3
votes
1answer
247 views

Saw an interesting command but can't alias it

Saw an command from this post http://askubuntu.com/a/266839/75967 that I would like to alias find {,/usr}/{,s}bin -printf '%f\0' | xargs -0 whatis | sort | less I assume the less or the | is ...
3
votes
2answers
3k views

Differences between fish and bash to pass commandline arguments to alias functions?

From the answers to my other question here i learned about the possibility to pass commandline arguments to a alias function in Bash. In Fish i can edit an alias by editing the file config.fish in ...
9
votes
2answers
1k views

What does the first '.' mean in '. ~/.bashrc'? [duplicate]

I saw a post about fix your alias in .bashrc. And he says after you put your alias in .bashrc , you need to use: . ~/.bashrc I do not quite understand what the first dot(' . ') does here. What's ...
4
votes
1answer
2k views

Aliases: difference between .bash_rc, .bash_aliases and /usr/local/bin

Playing around with Terminal, I noticed that there are many ways to create permanent aliases. I'm a Linux newbie, and from what I know, doing: sudo ln -s /path/to/esecutable ...
8
votes
2answers
781 views

What does the l command do?

There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
4
votes
1answer
6k views

Undertanding .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? (just confused so asking, I realize ...
2
votes
1answer
140 views

Is there a way to alias the command cd so that it protects the arguments?

When I run cd My folder There is an error because I have not protected the string. bash: cd: My: No such file or directory But this works fine cd "My folder" Is there a way to redefine cd as an ...
1
vote
1answer
338 views

Bash alias permanent <without running bash or . ~/.bashrc>

I'm used to putting my alias in .bashrc, but Ubuntu suggests putting them in .bash_aliases. So that's fine, I put my alias there in the .bash_aliases file. However I want to run my aliases once I ...
0
votes
0answers
20 views

Aliases don't work

I can't get this to work at all. I am running ubuntu 12.04 in virtual box and am trying to follow this tutorial. I have realised that I have .profile not .bash_profile. I typed: alias ...