restore the contents of a deleted file for which a descriptor is still available

N="filepath" ; P=/proc/$(lsof +L1 | grep "$N" | awk '{print $2}')/fd ; ls -l $P | sed -rn "/$N/s/.*([0-9]+) ->.*/\1/p" | xargs -I_ cat $P/_ > "$N"
Note that the file at the given path will have the contents of the (still) deleted file, but it is a new file with a new node number; in other words, this restores the data, but it does not actually "undelete" the old file. I posted a function declaration encapsulating this functionality to http://www.reddit.com/r/programming/comments/7yx6f/how_to_undelete_any_open_deleted_file_in_linux/c07sqwe (please excuse the crap formatting).

5
By: laburu
2009-02-21 02:31:24

What Others Think

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. ?????
KayGasaway · 99 weeks ago
I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! chute roto closer
KayGasaway · 98 weeks and 5 days ago
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. ?????
KayGasaway · 98 weeks and 1 day ago
Kampala International University is a leading international private university in Uganda offering world class learning to students around the world. KIU Alumni
goxah55535 · 96 weeks and 6 days ago
To check KBC Lottery Winner 2022 List WhatsApp or if you want to check KBC lottery number online please visit this KBC official website 2022. KBC WhatsApp Lucky Draw 2022
nakav51247 · 96 weeks and 6 days ago
Please continue this great work and I look forward to more of your awesome blog posts. ??????
KayGasaway · 94 weeks and 2 days ago
If you are looking for most powerful backlinks for your website then you are on right place : 100 Unique Domain
nakav51247 · 93 weeks and 6 days ago
Nice blog, I will keep visiting this blog very often. Nft opensea
KayGasaway · 93 weeks and 2 days ago
Theatmangroup is an online news company focused on covering the most important business and breaking news in US and around the globe. 500 toothed dinosaur
Audrey10 · 93 weeks and 1 day ago
It's a very good guide, Bless you designed for issuing all of us this post. Continue advertisment. http://mehfeel.net/mehfeel/blogs/post/322629">Sunset cruise muscat
nakav51247 · 92 weeks and 1 day ago
This is a lot of information to take in, but I am enjoying the thought process. I really am impressed with your article. Thank you. Porto Attractions tickets offers
fomajob · 91 weeks and 6 days ago
You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. spy phone app install
Audrey10 · 90 weeks ago
I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. snowmobile storage box
Audrey10 · 88 weeks and 5 days ago
The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. kanom456 pg
Audrey10 · 87 weeks ago
That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more. http://stmatthieuciteverte.com/ideal-laptop-brand/">this website
Audrey10 · 85 weeks and 4 days ago
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. Sbobet m
Audrey10 · 84 weeks and 5 days ago
To check KBC Lottery Winner 2022 List WhatsApp or if you want to check KBC lottery number online please visit this KBC official website 2022. KBC WhatsApp Lucky Draw 2022 KBC Lottery Number Check KBC Lottery Number Check Online 2022
kbcwinner11 · 84 weeks and 5 days ago
Our Affiliate Programs is FREE to Join and requires no special knowledge!.We’ll supply you with a range of banners to put on your website. Let us know what kind of commission type you want, and we’ll send you a percentage of the money we make from your link. It’s as simple as that. https://onohosting.com/
nakav51247 · 82 weeks and 5 days ago
So if the whole Rashard Lewis thing is true, then God must really hate LeBron James.|Only_Lightning| simply buzzes
STEPHEN007 · 80 weeks and 3 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
rahimhh21 · 79 weeks and 6 days ago
And since we're based in Australia, we understand how to effectively develop a cable sizing calculator app that's based on AS/NZS 3000 and AS/NZS 3008. cable sizing calculator
fomajob · 79 weeks and 6 days ago
To check KBC Lottery Winner 2022 List WhatsApp or if you want to check the KBC lottery number online please visit this KBC official website 2022. KBC WhatsApp Lucky Draw 2022 KBC Lottery Number Check [url=https://www.kbclotterywinneronlinecheck.com/]KBC Lottery Winner Check Online 2022[/url]
cassiefox699 · 78 weeks and 6 days ago
To check KBC Lottery Winner 2022 List WhatsApp or if you want to check the KBC lottery number online please visit this KBC official website 2022. KBC WhatsApp Lucky Draw 2022. KBC Lottery Check Online 2022
cassiefox699 · 78 weeks and 6 days ago
Since 2008, Perfect House Pug Puppies has been the leading Pug puppy breeder in the US, providing premium Pug puppies for sale. Each puppy exhibits the professionalism and knowledge that have set Perfect House Pug puppies apart from other pug puppy breeders. The professionals at Perfect House Pug Puppies are dedicated about finding their puppies loving, beloved homes where they can enjoy long, healthy lives. A companion that has been produced for quality, health, and temperament that satisfies the breed standard is guaranteed by Perfect House Pug puppies, the pug breeder that has set the benchmark for exceptional customer satisfaction. If you are looking to buy a baby pug, Black and white pugs, Mini pug puppies for sale, Black and tan pug for sale, Teacup pug puppies for sale, Female pug puppies, pug puppies for sale, pug puppies for sale near me, pug puppies for sale under $500 near me. Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies baby pug puppies for sale pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
Perfecthomepugs · 71 weeks and 6 days ago
Brigade Valencia is a luxurious residential development project from Brigade which is coming up in Bangalore, and the first tower to be launched, Cielo includes luxury flats. [url=https://www.brigade-valencia.net/]Brigade Valencia[/url]
nakav51247 · 58 weeks and 4 days ago
Info buat kalian yang mau berjudi slot online. Bila anda merupakan salah satu orang penggemar slot, sebaiknya mulai sekarang anda bermain lah di situs WINWIN838 . Tentu saja ada alasan mengapa hal tersebut disarankan. Bermain di slot online itu gampang, dan jelas aman bro. anda tak harus lagi deg deg ser jantungnya takut ada penggerebekan. Tentu saja pilihan agen slot nya pun banyak dan anda bisa bermain dengan sangat nyaman pada rtp live dan provider slot yang lainnya. Tentu saja bila anda ingin nyaman taruhan, salah satu hal yang perlu anda lakukan adalah dapatkan info RTP live yang valid. Dapatkan info terkini sehingga anda bisa bermain dengan tepat. Kalian dipastikan akan sangat nyaman bila ada di dunia maya untuk mainkan slot. Anda pasti juga akan sangat mungkin bermain slot sebab sudah tak ada lagi aturan deposit besar.
loanabilly · 58 weeks and 2 days ago
EVERYONE in the family Priority number one. We're small-scale, in-home breeders. We're not a facility or a kennel; we're a group of Pug enthusiasts who are utterly smitten with our adorable kids. Perfect House of Pugs is just breathtaking! Our Pugs have the best temperaments and personalities. They are created specifically for families looking for a high-quality Pug puppy. With over 18+ years, we have fought for only the finest standards, with our Pugs' health as our primary emphasis, which is why we put EVERYTHING into it, never cutting corners, always changing, and always improving. Our children are our greatest source of pride and delight. Our mission is to build connections (rather than merely sell puppies) and to bring pleasure and joy into your household. We are raising a Pug family and are certain that these puppies will become an integral part of your life. PLEASE VISIT OUR WEBSITE LINK BELLOW FOR MORE INFORMATION ABOUT PUG PUPPIES. PUG PUPPY ADOPTION Pug puppies for sale PUG PUPPIES FOR SALE NEAR ME PUG PUPPIES NEAR ME PUG PUPPIES FOR SALE UNDER 500 NEAR ME CUTE PUG PUPPIES BLACK PUG PUPPIES BLACK PUG PUPPIES FOR SALE PUG PUPPIES FOR ADOPTION BLACK PUG PUPPIES FOR SALE NEAR ME CHIHUAHUA PUG MIX PUPPIES TEACUP PUG PUPPIES HOW MUCH IS A PUG PUPPY BABY PUG PUPPIES PICTURES OF PUG PUPPIES PUG PUPPIES FOR SALE IN OHIO PUG PUPPIES FOR SALE IN PA PUG PUPPIES PRICE PUG MIX PUPPIES TEACUP PUG PUPPIES FOR SALE BABY PUG PUPPIES FOR SALE BEST FOOD FOR PUG PUPPY NEWBORN PUG PUPPIES PUG PUPPIES CRAIGSLIST PUG PUPPIES FOR SALE CRAIGSLIST WHITE PUG PUPPIES PUG PUPPIES FOR SALE IN MICHIGAN PUG PUPPIES FOR SALE UNDER 500 ADORABLE PUG PUPPIES BRINDLE PUG PUPPY HOW MUCH DOES A PUG PUPPY COST PITBULL PUG MIX PUPPIES PUGS FOR SALE NEAR ME PUG PUPPIES FOR SALE 200 PUG PUPPIES FOR SALE IN NJ PUG PUPPIES FOR SALE IN WISCONSIN PUG PUPPIES MICHIGAN PUG PUPPY COST MERLE PUG PUPPY FOR ADOPTION BEST PUG PUPPY FOOD ROYAL CANIN PUG PUPPY FOOD FAWN PUG PUPPY PUG PUPPIES FOR SALE FLORIDA PUG PUPPIES FOR SALE IN INDIANA PUG PUPPIES FOR SALE IN KY PUG PUPPIES FOR SALE IN NC PUG PUPPIES FOR SALE IN TEXAS PUG PUPPIES FOR SALE MN PUG DOG PUPPY AKC REGISTERED PUG PUPPIES FOR SALE PUG ALL BLACK CHEAP PUG PUPPIES FOR SALE NEAR ME PUGS PUPPIES FOR SALE CHEAP PUG PUPPIES FOR SALE IN CALIFORNIA MINIATURE PUG PUPPIES FOR SALE NEAR ME MINIATURE PUG PUPPIES FOR SALE CHEAP PUG PUPPIES FOR SALE IN NJ KNOWN FACTS ABOUT PUG PUPPIES ADOPT PUG PUPPIS RESCUE A PUG PUPPY PERFECT HOUSE OF PUGS PUG PUPPIES INSTAGRAM PINTEREST QUORA Google Page USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA
pugpuppies95 · 33 weeks and 6 days ago
Acquista Ossicodone ItaliaAcquista Ossicodone Italia  Acquista cocaina crack in linea cocaina a squame di pesce italia Acquista cocaina boliviana in linea Acquista Saxenda in Linea Acquista fentermina in linea italia Acquista Ozempic In Linea Acquista Stilnox in linea italia Acquista Ambien in linea italia Acquista Quaaludes in linea Acquista Metaqualone In Linea Acquista subutex in linea italia Acquista Adderall In linea italia Acquista Ossicodone 10 mg Sandoz italia Acquista Laudano droga online Acquista ossicodone pillole Acquista desoxyn in linea italia Acquista buprenorfina in linea italia Acquista ritalin in linea italia Acquista dilaudid in linea italia Acquista ritalin in linea italia Acquista Ossicodone 30 mg Sandoz italia Acquista fentanil in linea italia Acquista Ossicodone Italia Acquista Ossicodone Italia Acquista la morfina iniettabile Italia Acquista Ossicodone 80 mg Sandoz italia Acquista Xanax in linea italia Acquista strisce di Suboxone italia Acquista vyvanse in linea italia Acquista oxycontin in linea italia Acquista Percocet in linea italia Acquista ossicodone pillole in linea italia Acquista morfina in linea italia Acquista ossicodone in linea italia Buy wood online Buy wood pellets online  dried-pods for sale  opium-pods  for sale dried-papaver-pods  dried poppy pods in USA free dried podsdried poppy pods   körkort sverigekörkort sverige köp körkort köp falsk pass BESTÄLLA KÖRKORT ONLINE buy dried poppy pods online buy opium pods buy opium pods Buy dried poppies online dried poppy pods unwashed poppy pods for sale Dried poppy pods near me Poppy seed tea dried poppy pods for craft wholesale dried flowers USA Giant dried poppy heads dried poppy pods dried poppy pods   Führerschein kaufen ohne prüfungkaufen MPU GutachtenKaufen bootsführerschein onlineSchweizer Führerschein kaufen führerschein polen kaufen ohne prüfung FÜHRERSCHEIN ONLINE KAUFEN https://eu-fuhrerscheinlegal.com/product/kaufen-deutschland-fuhrerschein/ Buy wood online Buy wood pellets online
donperi1 · 27 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: