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
- How to Browse From the Linux Terminal Using W3M?
- How to copy a file's content from Linux terminal?
- Formatted text in Linux Terminal using Python
- Fun Commands in Linux
- Linux Commands
- How to run Linux Commands on Windows 10?
- Internal and External Commands in Linux
- Basic Shell Commands in Linux
- Essential Linux/Unix Commands
- Basic Linux Commands for day to day life
- Daily life Linux Commands
- halt, poweroff and reboot Commands in Linux
- Useful and time saving bash commands in Linux
- Python | Execute and parse Linux commands
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.