[Show all top banners]
Back to: Kurakani General Refresh page to view new replies
 UNIX help
[VIEWED 4548 TIMES]
SAVE! for ease of future access.
Posted on 02-18-12 8:29 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

 
Hello everyone,

Can anyone help me to create premanent alias in UNIX? It will be a great help.

Thank you.

 
Posted on 02-18-12 11:09 PM     [Snapshot: 40]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Do the following steps:
1. cd
2. vi .bashrc
3. alias command='aliasofcommand'
4. save and quit (:wq!)
5. exit and login again.

If this doesnot work for you then apply the same steps for .bash_profile
2. vi .bash_profile

This will create permanent alias for you.
Last edited: 18-Feb-12 11:27 PM

 
Posted on 02-18-12 11:37 PM     [Snapshot: 56]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 
 
Posted on 02-19-12 8:27 AM     [Snapshot: 109]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

save the alias in .cshrc file

it will create a permanet alias

 
Posted on 02-19-12 1:39 PM     [Snapshot: 205]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

 Comp,

depends on what shell you're running.

Bash is most common (comes default with ubuntu, archlinux) and for that you need to add the alias to ~/.bashrc OR a better way would be to add it to ~/.bash_aliases given that you have sourced ~/.bash_aliases from your bashrc. 

Everytime you invoke the shell, bash checks the bashrc file to see what configuration defaults to start with and if you have your alias set there, then it uses that too. 

So in your .bashrc or your .bash_aliases (i keep mine in aliases cuz i have a tonne of them and so makes it easier to manage) you set your alias like you would normally with

alias [your-alias-name] = "[whatever]"

Once you've saved your file, you can use the 'source' command to reload your configs like so:

source ~/.bash_aliases (or whatever file u wrote into).






 
Posted on 02-19-12 3:02 PM     [Snapshot: 239]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thank you Everyone for quick reponses.
 
I was also wondering if we can make alias without using assign operator.
I know we can make it on C shell but what about bash.

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 30 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
nrn citizenship
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
ढ्याउ गर्दा दसैँको खसी गनाउच
lost $3500 on penny stocks !!!
मन भित्र को पत्रै पत्र!
Nepalese Students Face Deportation over Pro-Palestine Protest
They are openly permitting undocumented immigrants to participate in federal elections in Arizona now.
Guess how many vaccines a one year old baby is given
जाडो, बा र म……
Is this a progressive step?
TPS Reregistration and EAD Approval Timeline.......
Trasiting through Istanbul, Turkey
Elderly parents travelling to US (any suggestions besides Special Assistance)?
कल्लाई मुर्ख भन्या ?
Changing job after i-140 approval
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters