IconIcon

Monday 16 December 2013

Create Your Own Terminal Commands In Ubuntu

Welcome back friends,


This trick is specially for linux users.


Today we will learn how to create your own command for linux terminal.


Are you tired of using same commands in linux terminal then be creative follow our steps:-



1. Go to your home folder - /home/amit where amit is your username.

2. Now right click- and select - create new document -> empty document.

Create Your Own Terminal Commands In Ubuntu

3. Now change name of that file to - .bash_aliases
  
    Note:- Remember to put dot before name - ".bash_aliases"



4.  Now open that file with text editor and use below syntax to create your own
      commands.


    Syntax:-   alias your-command='linux commands you want to change'

Example- I frequently use - cd /home/amit/papers   commands in linux terminal.
                   So I created my own command to use that command-
                   
                    alias papers='cd /home/amit/papers'

                   Now I can use command   - papers in linux terminal.

                   In this way you can create your own linux command.

       Note:- Remember that your command must not match with existing linux terminal command example - 
                    alias cd='cd /home/amit/papers'

                    In above example we created our own command - cd but it will not work
                    because there is cd command already in linux terminal.

                    Also remember that your command should not have space and it must be
                    lowercase letters only.



Create Your Own Terminal Commands In Ubuntu


5.  Now use above method and type your own linux command in text editor.

6. Now save - .bash_aliases file and open linux terminal to test your command.

                            GOOD LUCK!!!!!!!!!!!!

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...