« Return to Thread: tmpwatch problem

Re: Aliasing (was Re: tmpwatch problem)

by David Guntner-3 :: Rate this Message:

Reply to Author | View in Thread

Anne Wilson wrote:

> On Thursday 18 June 2009 22:35:37 Dick Gevers wrote:
>> On Thu, 18 Jun 2009 09:28:11 +0100, Anne Wilson wrote about Aliasing (was
>> Re: [Expert] tmpwatch problem):
>>>> For example:
>>>>
>>>> alias broom='/usr/sbin/tmpwatch --mtime --verbose 168 /home/anne/.tmp'
>>>
>>> Can that be done to add parameters?  I mean, for instance, on the F10
>>> netbook, I would like to alias 'yum update' to 'yum update --skip-broken'.
>>
>> Sure: e.g. alias yus='yum update --skip-broken'.
>>
>> Obviously, if you run it with sudo you'd have to include 'sudo' in front,
>> and if run as root, you could either put your alias as before in ~/.bashrc
>> (which is then same as /root/.bashrc), or in any file in /etc/profile.d .
>> My root aliases are in /etc/profile.d/z_<boxname>.sh
>
> Thanks.  I'm trying this - putting it in ~/.bashrc.  Don't know whether it
> needs it, but I ran newaliases anyway.  Then I tried 'yus' but got 'command
> not found'.  What have I missed?
The newaliases command builds the aliases db hash table for
sendmail/postfix. :-)

Your .bashrc file is only executed when a new shell is opened.  Close
the shell you're in after having put the alias command into it and open
a new shell window.  Or you can just type ". ~/.bashrc" to run it from
within the shell window in question (without the quotes, of course) so
you don't have to bring up a new shell.  Either way, your alias should
then be active.

                 --Dave



signature.asc (268 bytes) Download Attachment

 « Return to Thread: tmpwatch problem