I'm a newbie in Unix/Linux environment. Can anyone guide me to create custom commands in Unix/Linux. Thanks in advance
closed as too broad by Evan Teitelman, jasonwryan, Mat, Ulrich Dangel, Anthon Jul 28 '13 at 9:39Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. |
|||||
|
|||||
|
Create a bash script in your /usr/bin folder, it should look something like this
Its really that easy. Just name the bash script what you want to type in to the terminal, and make it excecutable: |
|||||||||||||
|
|
|||||||||
|
|
Easy, create an alias. Say you want to write a command to cd into your download directory. And you want to call it cdd.
You can create any command you want. Here is further information: |
|||||||||
|
|
Most, if not all by now, Linux distributions have a little script in ~/.bashrc that looks almost identical to this:
This merely means you can create your own commands (also known as ' Your Linux distribution will most likely not have the .bash_aliases file created in your home, unless you've manually done that already. So to create the file, type in the following command: Now that file will be executed automatically every time you fire off a new Terminal. What you can do now is create a list of aliases and add them to that file for later uses. For example, the
will tell If you want to learn how to use some basic commands (i.e. a practical guide to linux commands editors and shell programming, by Mark G. Sobell. ISBN: 978-0133085044 |
|||||
|