1. 1 year ago

    Link > rm all the results of a find

    I’d never had the need to remove everything found by the find command before. Since rm expects arguments, rather than piped input… it breaks the normal Unix pipe it all together paradigm.

    Some quick googling brought xargs into the picture though. xargs constructs an argument list from its piped input and executes its argument with them. Perfect for what I was trying to do:

    find . -name *.pyc -print0 | xargs -0 rm

    Unix

    Mac OS X

    Linux

  2. 1 year ago

    Enlarge an ext3 Amazon EBS volume

    Have an EBS volume that’s filling up? Follow these steps to enlarge it:

    At the EC2 Web Console

    1. Unmount the volume.
    2. Take a snapshot of the volume.
    3. Create a new volume from the snapshot (at the new, bigger size)
    4. Detach the old volume
    5. Attach the new, bigger volume.

    In a shell of the instance

    1. fdisk /dev/sdx  (then type: d, n, p, 1, <enter>, <enter>, w)
    2. ec2fsck -f /dev/sdx
    3. resize2fs -p /dev/sdx
    4. fsck -f -y dev/sdx
    5. mount /vol

    That’s all! Original source and details at:

    http://www.capsunlock.net/2009/06/enlarge-amazon-ebs-volume.html

    and 

    http://developer.amazonwebservices.com/connect/thread.jspa?messageID=112259

    Amazon AWS

    Linux

  3. 2 years ago

    Link > List the files from a Yum package

    repoquery is the tool you want. Who knew?

    Yum

    Linux