How to add an alias to a command in terminal?How to create shortcut for a command in terminal?Change command name in terminalHow to create shortcut commands in terminal?In terminal, how can I write 'sagi' instead of 'sudo apt-get install'Automatically pass command to TerminalRun a command using some textHow to create a permanent “alias”?Command line usage with dyslexiaHow can I disable usb-autosuspend for a specific device?Keyboard stops working Ubuntu 16.04How to run an alias in a shell script?Alias adder script in terminalSaw an interesting command but can't alias itHow can I install the alias command?add alias to rootAlias syntax for mpirunAlias not working as intended in .bashrc, while command doesHow can I use an alias in a function?How do I set an alias to a terminal line?
How to protect bash function from being overridden?
Would a horse be sufficient buffer to prevent injury when falling from a great height?
Can Fabled Passage generate two mana with Amulet of Vigor?
Why do many websites hide input when entering a OTP
Writing about real people - not giving offence
Could Boris Johnson face criminal charges for illegally proroguing Parliament?
Is morphing a creature effectively a cost?
Query to get counts of values per column
What is the Japanese equivalent of 'you're in my heart'?
Bothered by watching coworkers slacking off
Origin of movie opening crawl
Present participles of the verb esse
Did Joe Biden "stop a prosecution" into his son in Ukraine? And did he brag about stopping the prosecution?
Table formatting with multicolumn
Quote to show students don't have to fear making mistakes
Airport Security - advanced check, 4th amendment breach
Check if number is in list of numbers
Mac no longer boots
Disable all sound permanently
Is it appropriate to "shop" through high-impact journals before sending the paper to more specialized journals?
What are one's options when facing religious discrimination at the airport?
As a girl, how can I voice male characters effectively?
Has Boris Johnson ever referred to any of his opponents as "traitors"?
Canteen Cutlery Issue
How to add an alias to a command in terminal?
How to create shortcut for a command in terminal?Change command name in terminalHow to create shortcut commands in terminal?In terminal, how can I write 'sagi' instead of 'sudo apt-get install'Automatically pass command to TerminalRun a command using some textHow to create a permanent “alias”?Command line usage with dyslexiaHow can I disable usb-autosuspend for a specific device?Keyboard stops working Ubuntu 16.04How to run an alias in a shell script?Alias adder script in terminalSaw an interesting command but can't alias itHow can I install the alias command?add alias to rootAlias syntax for mpirunAlias not working as intended in .bashrc, while command doesHow can I use an alias in a function?How do I set an alias to a terminal line?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
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?
command-line bashrc alias
add a comment
|
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?
command-line bashrc alias
2
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40
add a comment
|
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?
command-line bashrc alias
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?
command-line bashrc alias
command-line bashrc alias
edited May 25 '17 at 4:34
Zanna
53.3k15 gold badges150 silver badges251 bronze badges
53.3k15 gold badges150 silver badges251 bronze badges
asked Jun 22 '12 at 14:49
Rootical V.Rootical V.
4552 gold badges7 silver badges12 bronze badges
4552 gold badges7 silver badges12 bronze badges
2
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40
add a comment
|
2
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40
2
2
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40
add a comment
|
7 Answers
7
active
oldest
votes
alias new_name='old command'
To create a permanent alias you have to edit the .bashrc
file in your home directory.
More info here
More .bashrc files here
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
add a comment
|
On the bash command line it is simply a case of typing:
alias my_command="Command to run"
For example to create a short command run a long listing you could do:
alias ll="ls -l"
The quotes are not required if you are not adding switches to the aliased command.
add a comment
|
To make permanent changes you can put your aliases separetely in ~/.bash_aliases
1
Don't forget to runsource ~/.bash_aliases
for the change to take effect.
– Stoyan Dimov
Nov 30 '18 at 10:40
add a comment
|
You can either use the alias
built-in command in the shell you're using, or you can write a script which does what you want. Assuming you are using bash as the shell (which is the default), you can type man bash
and skip down to the ALIASES
section, for documentation on aliases in bash.
add a comment
|
To learn about aliasing: visit http://www.mediacollege.com/linux/command/alias.html
To make the changes permanent (i.e. to be read everytime you start a shell) add the alias commands you typed in the terminal to the file ~/.bashrc file.
add a comment
|
I write a GUI for adding/editing alias commands. You can also use it from commandline like this:
addalias -add "sinstall" "sudo apt-get install"
https://github.com/isamert/addalias
add a comment
|
You can directly create a file in your home for collecting all the aliases .bash_profile
by writing nano ~.bash_profile
and simply write on the file the commands/shortcuts you want to create, for example:
alias edbp='nano ~/.bash_profile'
and then validate it sourcing the file, so running
source ~.bash_profile
Remember that every time you modify your document you have to run again source ~.bash_profile
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f154640%2fhow-to-add-an-alias-to-a-command-in-terminal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
alias new_name='old command'
To create a permanent alias you have to edit the .bashrc
file in your home directory.
More info here
More .bashrc files here
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
add a comment
|
alias new_name='old command'
To create a permanent alias you have to edit the .bashrc
file in your home directory.
More info here
More .bashrc files here
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
add a comment
|
alias new_name='old command'
To create a permanent alias you have to edit the .bashrc
file in your home directory.
More info here
More .bashrc files here
alias new_name='old command'
To create a permanent alias you have to edit the .bashrc
file in your home directory.
More info here
More .bashrc files here
edited May 25 '17 at 4:35
Zanna
53.3k15 gold badges150 silver badges251 bronze badges
53.3k15 gold badges150 silver badges251 bronze badges
answered Jun 22 '12 at 14:59
OrangeTuxOrangeTux
3,7388 gold badges25 silver badges53 bronze badges
3,7388 gold badges25 silver badges53 bronze badges
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
add a comment
|
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
1
1
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
There is no manual entry for alias. It is a built-in command. You must look at the man page for the shell.
– dobey
Jun 22 '12 at 15:40
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
Changed it. ty.
– OrangeTux
Jun 23 '12 at 7:04
add a comment
|
On the bash command line it is simply a case of typing:
alias my_command="Command to run"
For example to create a short command run a long listing you could do:
alias ll="ls -l"
The quotes are not required if you are not adding switches to the aliased command.
add a comment
|
On the bash command line it is simply a case of typing:
alias my_command="Command to run"
For example to create a short command run a long listing you could do:
alias ll="ls -l"
The quotes are not required if you are not adding switches to the aliased command.
add a comment
|
On the bash command line it is simply a case of typing:
alias my_command="Command to run"
For example to create a short command run a long listing you could do:
alias ll="ls -l"
The quotes are not required if you are not adding switches to the aliased command.
On the bash command line it is simply a case of typing:
alias my_command="Command to run"
For example to create a short command run a long listing you could do:
alias ll="ls -l"
The quotes are not required if you are not adding switches to the aliased command.
edited Jun 15 '13 at 18:44
Radu Rădeanu
127k36 gold badges269 silver badges335 bronze badges
127k36 gold badges269 silver badges335 bronze badges
answered Jun 22 '12 at 15:00
AdamAdam
2761 silver badge6 bronze badges
2761 silver badge6 bronze badges
add a comment
|
add a comment
|
To make permanent changes you can put your aliases separetely in ~/.bash_aliases
1
Don't forget to runsource ~/.bash_aliases
for the change to take effect.
– Stoyan Dimov
Nov 30 '18 at 10:40
add a comment
|
To make permanent changes you can put your aliases separetely in ~/.bash_aliases
1
Don't forget to runsource ~/.bash_aliases
for the change to take effect.
– Stoyan Dimov
Nov 30 '18 at 10:40
add a comment
|
To make permanent changes you can put your aliases separetely in ~/.bash_aliases
To make permanent changes you can put your aliases separetely in ~/.bash_aliases
edited May 25 '17 at 4:36
Zanna
53.3k15 gold badges150 silver badges251 bronze badges
53.3k15 gold badges150 silver badges251 bronze badges
answered Mar 25 '13 at 8:35
Yann SagonYann Sagon
2211 gold badge3 silver badges5 bronze badges
2211 gold badge3 silver badges5 bronze badges
1
Don't forget to runsource ~/.bash_aliases
for the change to take effect.
– Stoyan Dimov
Nov 30 '18 at 10:40
add a comment
|
1
Don't forget to runsource ~/.bash_aliases
for the change to take effect.
– Stoyan Dimov
Nov 30 '18 at 10:40
1
1
Don't forget to run
source ~/.bash_aliases
for the change to take effect.– Stoyan Dimov
Nov 30 '18 at 10:40
Don't forget to run
source ~/.bash_aliases
for the change to take effect.– Stoyan Dimov
Nov 30 '18 at 10:40
add a comment
|
You can either use the alias
built-in command in the shell you're using, or you can write a script which does what you want. Assuming you are using bash as the shell (which is the default), you can type man bash
and skip down to the ALIASES
section, for documentation on aliases in bash.
add a comment
|
You can either use the alias
built-in command in the shell you're using, or you can write a script which does what you want. Assuming you are using bash as the shell (which is the default), you can type man bash
and skip down to the ALIASES
section, for documentation on aliases in bash.
add a comment
|
You can either use the alias
built-in command in the shell you're using, or you can write a script which does what you want. Assuming you are using bash as the shell (which is the default), you can type man bash
and skip down to the ALIASES
section, for documentation on aliases in bash.
You can either use the alias
built-in command in the shell you're using, or you can write a script which does what you want. Assuming you are using bash as the shell (which is the default), you can type man bash
and skip down to the ALIASES
section, for documentation on aliases in bash.
answered Jun 22 '12 at 14:58
dobeydobey
34.3k3 gold badges41 silver badges88 bronze badges
34.3k3 gold badges41 silver badges88 bronze badges
add a comment
|
add a comment
|
To learn about aliasing: visit http://www.mediacollege.com/linux/command/alias.html
To make the changes permanent (i.e. to be read everytime you start a shell) add the alias commands you typed in the terminal to the file ~/.bashrc file.
add a comment
|
To learn about aliasing: visit http://www.mediacollege.com/linux/command/alias.html
To make the changes permanent (i.e. to be read everytime you start a shell) add the alias commands you typed in the terminal to the file ~/.bashrc file.
add a comment
|
To learn about aliasing: visit http://www.mediacollege.com/linux/command/alias.html
To make the changes permanent (i.e. to be read everytime you start a shell) add the alias commands you typed in the terminal to the file ~/.bashrc file.
To learn about aliasing: visit http://www.mediacollege.com/linux/command/alias.html
To make the changes permanent (i.e. to be read everytime you start a shell) add the alias commands you typed in the terminal to the file ~/.bashrc file.
answered Jun 22 '12 at 14:58
drake01drake01
2,8351 gold badge14 silver badges13 bronze badges
2,8351 gold badge14 silver badges13 bronze badges
add a comment
|
add a comment
|
I write a GUI for adding/editing alias commands. You can also use it from commandline like this:
addalias -add "sinstall" "sudo apt-get install"
https://github.com/isamert/addalias
add a comment
|
I write a GUI for adding/editing alias commands. You can also use it from commandline like this:
addalias -add "sinstall" "sudo apt-get install"
https://github.com/isamert/addalias
add a comment
|
I write a GUI for adding/editing alias commands. You can also use it from commandline like this:
addalias -add "sinstall" "sudo apt-get install"
https://github.com/isamert/addalias
I write a GUI for adding/editing alias commands. You can also use it from commandline like this:
addalias -add "sinstall" "sudo apt-get install"
https://github.com/isamert/addalias
answered Aug 14 '14 at 12:51
isamertisamert
1465 bronze badges
1465 bronze badges
add a comment
|
add a comment
|
You can directly create a file in your home for collecting all the aliases .bash_profile
by writing nano ~.bash_profile
and simply write on the file the commands/shortcuts you want to create, for example:
alias edbp='nano ~/.bash_profile'
and then validate it sourcing the file, so running
source ~.bash_profile
Remember that every time you modify your document you have to run again source ~.bash_profile
add a comment
|
You can directly create a file in your home for collecting all the aliases .bash_profile
by writing nano ~.bash_profile
and simply write on the file the commands/shortcuts you want to create, for example:
alias edbp='nano ~/.bash_profile'
and then validate it sourcing the file, so running
source ~.bash_profile
Remember that every time you modify your document you have to run again source ~.bash_profile
add a comment
|
You can directly create a file in your home for collecting all the aliases .bash_profile
by writing nano ~.bash_profile
and simply write on the file the commands/shortcuts you want to create, for example:
alias edbp='nano ~/.bash_profile'
and then validate it sourcing the file, so running
source ~.bash_profile
Remember that every time you modify your document you have to run again source ~.bash_profile
You can directly create a file in your home for collecting all the aliases .bash_profile
by writing nano ~.bash_profile
and simply write on the file the commands/shortcuts you want to create, for example:
alias edbp='nano ~/.bash_profile'
and then validate it sourcing the file, so running
source ~.bash_profile
Remember that every time you modify your document you have to run again source ~.bash_profile
answered Jan 24 at 15:02
Erik PillonErik Pillon
1012 bronze badges
1012 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f154640%2fhow-to-add-an-alias-to-a-command-in-terminal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
See also here: askubuntu.com/questions/1414/how-to-create-a-permanent-alias
– Takkat
Jun 22 '12 at 17:40