A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Wednesday, August 3, 2011

LINUX ALIAS COMMAND

9:35:00 PM Posted by Satish , , No comments

Using alias commands you can easily perform your regular jobs.

1, open "~/.bashrc" in any editor.

          vi ~/.bashrc

2. Add your alias commands at the end of the file.

Ex:

              #Tomcat Alias
              alias starttomcat='/usr/apache-tomcat-6.0.26/bin/catalina.sh jpda start'
              alias stoptomcat='/usr/apache-tomcat-6.0.26/bin/catalina.sh jpda stop'
              alias cleantomcat='sudo rm -rf /usr/apache-tomcat-6.0.26/work/Catalina/localhost/*'
              alias ctlog='tail -f /usr/apache-tomcat-6.0.26/logs/catalina.out'
              alias flushctlog='>/usr/apache-tomcat-6.0.26/logs/catalina.out'

              #Apache Alias
              alias startapache='sudo /etc/init.d/apache2 start'
              alias startapache='sudo /etc/init.d/apache2 stop'
              alias restartapache='sudo /etc/init.d/apache2 restart'


3. load the aliases again.

          . ~/.bashrc

Now you can use the alias name any where in the command prompt.

0 comments:

Post a Comment