Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
can anyone advice me about /etc/aliases file ?
I need to put some entry on this file but not getting on its place..not even somewhere elses... I made a search and now confirm i don't have that file on my Redhat-9 box.
is this something like i have to make the file manually ? (but i guess, its a system file that creats automatically, cuz on redhat-6.2 i got it right place)
sixth_sense, my aliases live in ~/.bashrc; maybe yours do, too. It's worth a check.
Certainly you should be able to add new aliases to that file in order to accomplish your goal; adding them to any /etc file would be a global setting, and probably not recommended in any case.
Trickykid, aliases are very useful console "shortcuts". You can type 'alias' in a console and see if you have any already set.
For example, here's a couple of mine:
alias kernel="cd /usr/src/linux/"
alias source="cd /usr/local/src/"
So, in a terminal, if I want to go to the kernel directory (because I'm going to make menuconfig or whatever), I don't have to type "cd /usr/src/linux"... I can just type 'kernel' and hit enter, and it will perform that command, because I have told Linux that "kernel" is an alias for the command "cd /usr/src/linux". And you can do this with a lot of commands that you may use often, you can make different aliases for the same command with different switches... it's really useful if you use the terminal or command line a fair bit.
From what I can see, /etc/aliases is a file installed by sendmail, as DavidPhillips said. Do you have sendmail installed?
Second, as bulliver said, what you're trying to add with the "alias teest=" is a shell alias, which commands are not read from /etc/aliases (because /etc/aliases is for sendmail mail aliases; alias is a command and aliases is a file). From all I can find (I've used a lot of distros, but Gentoo is the first one where I've ever used and editied my shell aliases, so I don't know if or how the configuration is different on other distros), shell aliases are best entered in ~/.bashrc, which bash will always look for. This of course assumes that you're using the bash shell in the first place.
You should probably try entering alias without any parameters to see what has been set for you already by RedHat. This will also help because if you know what aliases you already have, you can check to see what file they are being set in and then simply add to it. Check ~/.bashrc first, as that's where they likely are, but if not there, then ~/.bash_profile, if not there, then look at /etc/profile (probably not here, but possible), /etc/profile.local (if it exists) or /etc/bashrc (if it exists). You can do a test of the alias command you're trying to enter by not even trying to enter it in a file, but simply opening a terminal and setting alias teest="cd /usr/local/postfix-2.0.19/" then typing teest immediately in the same terminal. However, this will be forgotten as soon as you close the terminal. If you're satisfied, you can then add it to your .bashrc (where you will likely find the other aliases that were pre-set as well). You might also want to set the aliases you've created in root's .bashrc as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.