LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-25-2005, 09:14 AM   #1
lazwaz
LQ Newbie
 
Registered: Apr 2005
Posts: 6

Rep: Reputation: 0
alias help


Hi,

Suppose i create an alias as follows...

#alias test="ls -l"


now i want to know wher exactly the command 'test' will be stored??
I want to know the path where it is stored
hope u can help me out


Thank you,

regards,

George
 
Old 04-25-2005, 09:20 AM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
There isn't actually a command called 'test' created. alias just tells bash that if it see's 'test' it should run the 'ls' command with the '-l' flag.
 
Old 04-27-2005, 10:19 PM   #3
tkt
Member
 
Registered: Apr 2005
Posts: 37

Rep: Reputation: 15
Hi,

May I know which configuration file should I add my alias to?

Thanks.
 
Old 04-28-2005, 02:08 AM   #4
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

this depends on your shell.
supposing bash, add the lines to
Code:
$HOME/.bashrc
regards

slackie1000
 
Old 04-28-2005, 10:00 AM   #5
tkt
Member
 
Registered: Apr 2005
Posts: 37

Rep: Reputation: 15
Hi,

I added the alias to /root/.bashrc, but it just didn't seem to work. Anything wrong with that?

Thanks.
 
Old 04-28-2005, 11:13 AM   #6
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

are you running as root???
you need to restart the shell session to get effects
Code:
bash
regards
slackie1000
 
Old 04-28-2005, 07:02 PM   #7
tkt
Member
 
Registered: Apr 2005
Posts: 37

Rep: Reputation: 15
Hi,

I logged on as root. I tried to run bash after adding alias in /root/.bashrc, but still it didn't work. How to solve this?

Thanks.
 
Old 04-28-2005, 10:26 PM   #8
gnukish
Member
 
Registered: Apr 2005
Location: Neverland
Distribution: Slackware / Ubuntu
Posts: 171

Rep: Reputation: 30
Hi ,
Can u plz tell me what file should be edited in knoppix for alias.

I already know how to use alias command.But I was unaware of the fact that there's a file to be config'ed to have it permanently.

For information purpose only I wanna know it. I dont worry abt typing linux commands.

(alias if used always will let you down when u work in a public computer where the linux may not be config'ed as in ur pc)

I have been used to linux commands without , knowing this.thats a different issue.
 
Old 04-29-2005, 02:54 AM   #9
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

let's not hijack threads please...
ok. i will give a solution but i have no responsabilities. if your computer explodes, it is your problem.
setting config file for shells can be a pain. there is this issue, which file is read first, which has the prio and if you use a login shell or not.
the manual gives you some tips. i use a quick and dirty method that works quite nice for me.
here it goes:
1. be sure that the user that you want to set has bash as default shell. you can check it using "finger" and/or change it editing /etc/passwd
2. create/copy the default file "/etc/profile" to your user home naming it as ".bashrc"
3. create symlink as follows
Code:
cd $USER
ln -s .bashrc .profile
ln -s .bashrc .bash_login
ln -s .bashrc .bash_profile
close your shell and restart again.
this is not the correct method. it just works.

regards

slackie1000
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
ip alias mindcry Linux - Networking 0 10-16-2003 07:41 PM
using alias intruptz Linux - General 5 09-17-2003 04:32 AM
alias booyah Slackware 3 05-06-2003 03:17 PM
alias nobu Slackware 5 01-11-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration