Java Mailing List Archive

http://www.redhatconfig.com/

Home » Ubuntu Technical Support »

Re: Daily maintenance

Derek Broughton

2008-06-19

Replies: Find Java Web Hosting

Author LoginPost Reply
David Vincent wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Derek Broughton wrote:
>> I run this weekly:
>>
>> aptitude search '~i !~M' | tr -s ' ' | cut -f 2 -d ' '
>> /etc/apt/installed.txt

You lost the ">" redirection in there...

aptitude search '~i !~M' | tr -s ' ' | \
 cut -f 2 -d ' ' > /etc/apt/installed.txt

>>
>> (all on one line, of course) which gives me a convenient list of
>> currently installed packages so that I can duplicate this setup on a new
>> install.
>
> hrm, that gives me an empty file.
>
> sudo aptitude search '~i !~M' | tr -s ' ' | cut -f 2 -d ' '
> > /home/dvincent/installed.txt
>
> do i need the sudo? i've been wondering how to get a list of packages
> like this.

LOL. I never even thought about it. This runs from /etc/cron.weekly, so it
runs as root, and wouldn't need sudo anyway! It _does_ have to be able to
write (in my case) into /etc, which is probably why there's a "sudo" in it.
otoh, ime, "sudo" never worked for redirecting output.
--
derek


--
ubuntu-users mailing list
ubuntu-users@(protected)
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.