View the Most Wanted LQ Wiki articles.
Go Back > Blogs
User Name



Removing files with find, and LVM snapshots

Posted 04-24-2012 at 12:21 PM by sag47
Tags find, lvm, snapshot

Take an LVM snapshot using a loopback device
Create the snapshot
Take a look at the devices in your volume group. First there needs to be sufficient space in the volume group for a snapshot to occur. Check this by typing: vgdisplay and checking for Free PE / Size
vgdisplay -v
Create a loopback device to use for the snapshot. My volume group is named vg_echo360. I want my snapshot to be 9.9GB in size so I'm creating a loopback device which is 10GB in size....
Senior Member
Posted in Uncategorized
Views 1147 Comments 0 sag47 is offline

Simulate -print0 with ls

Posted 09-07-2011 at 04:39 AM by sag47
Tags find

Recently I wanted to manipulate files only in the current directory (not sub-directories). I usually use the following combination...

find . -type f -print0 | xargs -0 somecommand
The only problem I had with that was it ran through all sub-directories as well. Then I remembered the -m switch for ls and decided to depend on my good old friend sed.

ls -m | sed 's/, /\x0/g' | xargs -0 somecommand
Though I guess it would be better to do it...
Senior Member
Posted in Uncategorized
Views 1935 Comments 0 sag47 is offline


All times are GMT -5. The time now is 07:32 PM.

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