Linux operating system allows users to create commands and execute them over the command line. To create a command in Linux, the first step is to create a bash script for the command. The second step is to make the command executable.
$ nano .bashrc
Here, bashrc means run the Bash file. Bash is located at /bin/bash . This file helps in creating environment with help of startup files. nano is text editor. Instead of nano, you can use gedit text editor which is GUI base and most of the users are comfortable with it. Then we have to search content as shown below.
# some more ls aliases alias ll='ls -l' alias la='ls -A' alias l='ls -CF'
In the above figure :
alias :It allow to user to make custom commands.
unalias :It allow to user to stop working of any command.
Make custom command for our own purpose :
alias [name]=' [command 1]; [command 2]; [command 3]; ..... [command n]'
In place of name provide your custom command.
In place of command 1 provide first command that you want to exceute.
In place of command 2 provide second command that you want to exceute.
alias ok='echo hELLo WorlD; firefox'
echo hELLo WorlD it will display hELLo WorlD in termainal.
Enter your commands in sequence and then hit CTRL + O to save your commands in file.
Then, hit ENTER for the confirmation and then, hit CTRL + X to exit from file. Now, Restart your terminal.
Now, whenever you will type ok it will execute your command.
- Cool Custom Welcome Messages on Linux terminal
- Interesting Commands on Mac Terminal
- Terminal Mail and Linux Security Mail
- Formatted text in Linux Terminal using Python
- How to copy a file's content from Linux terminal?
- How to Browse From the Linux Terminal Using W3M?
- Using Lynx to Browse the Web From the Linux Terminal
- Few Tips for Fast & Productive Work on a Linux Terminal
- Shortcut to Move to the Beginning or Ending of a Command in Linux Terminal
- Kali Linux - Terminal and Shell
- Basic System Controls with Terminal in Linux
- Daily life Linux Commands
- Basic Linux Commands for day to day life
- Network configuration and trouble shooting commands in Linux
- Important Linux Commands (leave, diff, cal, ncal, locate and ln)
- Essential Linux/Unix Commands
- Internal and External Commands in Linux
- Useful and time saving bash commands in Linux
- halt, poweroff and reboot Commands in Linux
- Fun Commands in Linux
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.