Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page command line aliases after restart?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 03-02-2004   #1 (permalink)
Trent2800
Just Joined!
 
Join Date: Feb 2004
Location: Minnesota
Posts: 11
Send a message via ICQ to Trent2800 Send a message via AIM to Trent2800 Send a message via MSN to Trent2800 Send a message via Yahoo to Trent2800
command line aliases after restart?

How do I keep my alias entries after I restart? (the alias whatever=command command)
__________________
This is a most disturbing universe, indeed.
--Maggie Simpson
Trent2800 is offline   Reply With Quote
Old 03-02-2004   #2 (permalink)
sarumont
Content Team Leader
 
sarumont's Avatar
 
Join Date: Apr 2003
Location: /dev/urandom
Posts: 3,662
Are you referring to command line aliases? If so, then just add the 'alias=' entry to your ~/.bashrc
sarumont is offline   Reply With Quote
Old 03-02-2004   #3 (permalink)
lugoteehalt
Just Joined!
 
lugoteehalt's Avatar
 
Join Date: Jan 2004
Posts: 94
According to the manual, the bit about funtions, it is almost always preferrable to use functions rather than aliases.

Well, it interests me.
__________________
All power is violence; all power is evil.
lugoteehalt is offline   Reply With Quote
Old 03-02-2004   #4 (permalink)
heartsmagic
Linux Newbie
 
Join Date: Mar 2003
Location: Istanbul/Türkiye
Posts: 246
Quote:
Originally Posted by lugoteehalt
According to the manual, the bit about funtions, it is almost always preferrable to use functions rather than aliases.

Well, it interests me.
I agree with you lugoteehalt. Aliases dont take parameters like $1. So functions are always preferable.

I learnt this here, this forum [/b]
__________________
Just a Newbie....Looking 4 Info....
heartsmagic is offline   Reply With Quote
Old 03-02-2004   #5 (permalink)
danbo
Linux Newbie
 
Join Date: Feb 2003
Location: Swansea (UK)
Posts: 221
i'm not on linux now so i cant check the MAN Alias.......What is the format that these aliases are wrote in?
danbo is offline   Reply With Quote
Old 03-02-2004   #6 (permalink)
Dolda2000
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
Well, there are still cases where aliases are preferrable. Aliases can be thought of as just a simple command expansion. For example, if you run this:
Code:
alias 'ls=ls --color'
If you then run `ls *.c', it will expand `ls' into `ls --color', so that the command line that it runs becomes `ls --color *.c'. That's all there is to aliases. Whether you want to use an alias or a function depends on the application.
Dolda2000 is offline   Reply With Quote
Old 03-02-2004   #7 (permalink)
danbo
Linux Newbie
 
Join Date: Feb 2003
Location: Swansea (UK)
Posts: 221
so could i do
Code:
Alias winmount=mount dev/hda1 mnt/WINNT
Then if i typed 'winmount' it would mount my windows partition, would that alias work?
danbo is offline   Reply With Quote
Old 03-02-2004   #8 (permalink)
Dolda2000
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
Nope. That wouldn't work since you haven't quoted it properly. This, however, would work:
Code:
alias 'winmount=mount /dev/hda1 /mnt/WINNT'
Dolda2000 is offline   Reply With Quote
Old 03-02-2004   #9 (permalink)
danbo
Linux Newbie
 
Join Date: Feb 2003
Location: Swansea (UK)
Posts: 221
Quote:
Originally Posted by Dolda2000
Nope. That wouldn't work since you haven't quoted it properly. This, however, would work:
Code:
alias 'winmount=mount /dev/hda1 /mnt/WINNT'
haha it wondered why i never worked
danbo is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:59 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0