Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-04-2005, 02:19 AM
|
#1
|
LQ Newbie
Registered: Nov 2004
Location: Minnesota
Distribution: Debian, Fedora, Red Hat
Posts: 9
Rep:
|
Another Newbie question....Alias
I have a command I like to use a lot with a particular parameter and I would like to have it execute that way by just typing the command. I know I read this somewhere and it's pretty easy, but I forget how and I don't know where to look. What's the command?
|
|
|
03-04-2005, 02:26 AM
|
#2
|
Senior Member
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037
Rep:
|
hi there,
this depends of which shell you are using.
supposing bash, try
Code:
alias something="something --blah --blah"
then your command "something" will be executed automatic with the parameters --blah --blah.
you if want that forever, add this line to your .bashrc file.
regards
slackie1000
|
|
|
03-04-2005, 02:33 AM
|
#3
|
Member
Registered: Aug 2003
Location: Vancouver, Canada
Distribution: mepis 3.3.1
Posts: 82
Rep:
|
if you do that, can you then use that command, with a different set of arguments? ie if you
Code:
alias shutdown=shutdown -h now
could you then ?? Just wondering
Ampex189
|
|
|
03-04-2005, 02:36 AM
|
#4
|
Member
Registered: Feb 2005
Location: India
Distribution: RHEL 3
Posts: 108
Rep:
|
in that case u will need to write a shell script instead of just alias.
|
|
|
03-04-2005, 04:29 AM
|
#5
|
Senior Member
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037
Rep:
|
yep,
indeed and that is the danger to make everything an alias...
you could use sometrick like calling your first alias shutdown1 but this could bring a mess quite fast to your computer.
i agree with krishvij, write a small shell script and everything is solved keeping the feng-shui...
regards
slackie1000
|
|
|
03-04-2005, 10:58 AM
|
#6
|
LQ Newbie
Registered: Nov 2004
Location: Minnesota
Distribution: Debian, Fedora, Red Hat
Posts: 9
Original Poster
Rep:
|
Thanks Slackie!
I guess I kind of answered that myself. Let's just say I want to take a look at the .bashrc file and make this change permanent, but I'm not quite sure where to look. If I use "find" I need to specify a path name. Is there a way to look if the absolute path is unknown?
Once I find this file, I can open it with a text editor and add the line at the bottom, correct? I think I'm going to try to work with emacs for now. Good start?
|
|
|
All times are GMT -5. The time now is 12:39 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|