Showing posts with label .bash_profile. Show all posts
Showing posts with label .bash_profile. Show all posts

Tuesday, April 8, 2025

Do you have 'alias' in your .bash_profile or .bashrc??

Making mistake is human nature but, overcoming that mistake turning to desired outcome is very wise thing. You want to learn about that wise trick?

If yes, follow my post details more about my learnings on alias!!

In Unix platform there is a file called .profile (some Linux environments it is .bash_profile). Which executed automatically when you logon to your user, which intern have the environment variables which are required to run your application on WebLogic. For WLA required to setup a standard. profile for his production environment that is for JAVA_HOME, WL_HOME are major some of the environments requires ORA_HOME in this file.

Bash profile or bashrc with alias

 

Defining JAVA_HOME, WL_HOME, etc is common thing for any WLA. But your my Smart WLA then you might applying a intersting UNIX command 'alias'. Most of the time we use 'ls' command for listing the files/folders. By mistake you might mistype as 'sl' instead of 'ls'. sometimes feeling hungry!! or thirsty!! and typing command that may go wrong like 'cd..' or 'cd...'. Collect all these common mis typos and make use of 'alias' command then see!!

Though, you make mistake in typing it will give you desired command output. I like this command, since when I found it. This command makes magic, it is very interesting feature in UNIX. Just append to your .profile the following lines:
######WLA Smart idea for using alias #############################
alias cls=clear
alias sl=ls 
alias cd..="cd .."
alias cd...="cd ../.."
alias gi="grep -i"
alias l="ls -al"
alias lm="ls -al | more"
alias h=history
alias hm="history | more"

How to remove alias? or unalias

You may need to know how to remove the alias to have complete knowledge on it. To do this we need to use 'unalias' command it is simple. Let's do it on our 'l' alias we can unalias as:
unalias l
  
This is value added to your work, obviously it will reduce your time spending on working on your terminal. Performance will be improved if you find more common mistakes in your environment and sort-out with 'alias' the magical command, it will give you fruits as results!!

Do you have more ideas around this alias command please share in the comment box. Love to hear from you!!

Blurb about this blog

Blurb about this blog

Essential Middleware Administration takes in-depth look at the fundamental relationship between Middleware and Operating Environment such as Solaris or Linux, HP-UX. Scope of this blog is associated with beginner or an experienced Middleware Team members, Middleware developer, Middleware Architects, you will be able to apply any of these automation scripts which are takeaways, because they are generalized it is like ready to use. Most of the experimented scripts are implemented in production environments.
You have any ideas for Contributing to a Middleware Admin? mail to me wlatechtrainer@gmail.com
QK7QN6U9ZST6