LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Removing files with find, and LVM snapshots

Posted 04-24-2012 at 11:21 AM 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
Code:
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 903 Comments 0 sag47 is offline
Old

Simulate -print0 with ls

Posted 09-07-2011 at 03: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...

Code:
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.

Code:
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 1389 Comments 0 sag47 is offline

  



All times are GMT -5. The time now is 10:45 AM.

Main Menu

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