3 ms·
Don't forget that you can use lsof to undelete files (provided that at least one process still has the file open): http://www.linux.com/archive/articles/58142 h
by jf 17y ago
Don't forget that you can use lsof to undelete files (provided that at least one process still has the file open): http://www.linux.com/archive/articles/58142 http://www.linux.com/archive/articles/58142
- nailer 17y agoI think your post is actually more useful than the article.
- mattiss 17y agoExcellent! I think I know Unix pretty well, but it would be great if someone had a directory of common use scenarios that one could look through, rather than using Google and wading through horrible forum posts...
- Estragon 17y agoNot completely sure what you're asking for, here, but Command Line Fu might be in the ball park: http://www.commandlinefu.com/commands/browse http://www.commandlinefu.com/commands/browse
- PStamatiou 17y agodoesn't seem like that's possible in OS X due to no /proc natively. I'm going to see if I can do it with MacFUSE & procfs..
- ars 17y agoYou don't have to use lsof for that. Just find the pid of the process that has it open, then cd /proc/<pid>/fd and then ls -l lsof doesn't really do anything for you if you know the pid already. (But it's great if you don't know the pid.) Then, look through the list for your file, and copy the file descriptor just like in the article.
- ajross 17y agoThis is true, but only in the kinda trivial sense that lsof is just a pretty front end to the /proc filesystem. The same is true of pmap and netstat, but they remain useful tools nonetheless.
- wizard_2 17y agolsof predates the proc filesystem if I recall correctly
- FooBarWidget 17y agoIndeed. lsof is available on OS X too, which doesn't have /proc.