LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   which process uses a busy file/directory (https://www.linuxquestions.org/questions/linux-software-2/which-process-uses-a-busy-file-directory-81711/)

dwof 08-13-2003 04:15 PM

which process uses a busy file/directory
 
Hi People,

What is the command to check which process uses a certain file or directory. When I want to unmount a directory that is busy, I would like to check which process/usr/etc uses that directory.
I know there should be a way to check this, I even used it once, but I completely forgot what it is and where I found it.

Thank,

Dolf.

dwof 08-13-2003 04:19 PM

It may be a good idea to have a good database with all the linux commands and most basic/used command-line programs, together with searchable descriptions so it would be easy to find the right command. The tips 'n tricks, mentionned in two threads on this forum, could also be included in that.
If some person was a lot faster than me (which wouldn surprise me at all;)) and all this exists already, please tell me where I can find it.
Thanks,

Dolf.

acid2000 08-13-2003 04:45 PM

The command exits but I can't remeber it. Does it begin with p? No help i'm sure.

unSpawn 08-13-2003 04:57 PM

The database is "whatis", its accessed using "apropos".
The command to check on files in use is, depending on your needs, "fuser" or "lsof".

dwof 08-13-2003 05:06 PM

Quote:

Originally posted by unSpawn
The database is "whatis", its accessed using "apropos".

Thanks, the lsof was what I was looking for.

About the database, what do you mean. Is there I database like the one I was thinking about? And where is it? On hte internet or on my linux box. What is ¨whatis¨ and what is ¨apropos¨. I dont understand that part of your message.

Thanks for helping.

Cheers,
Dolf.

unSpawn 08-13-2003 05:35 PM

Do "man whatis" and "man apropos" on your box. Lo and behold :-]

dwof 08-13-2003 05:43 PM

Great! I didn't knwo there was such a database on my linux box. Are there more databases I should know about except locate en whatis? I would have found fuser end lsof myself if I knew about apropos.

Tip for people reading this, use apropos keyword|grep secondkeyword to refine your search.

Cheers,

Dolf.

Proud 08-13-2003 05:46 PM

Btw it seems that if you've cd'ed into a directory and then want to unmount something from it, you cant. You'll have to cd to somewhere else before using umount.

dwof 08-13-2003 05:59 PM

I know. There was a process using a file in the share I was trying to unmount. found the process, program an the specific file being used. Decided to kill it. Problem solved. lsof works better than fuser for this because it also gives back the user, program and specific file concerned. More information than fuser.

Dolf.


All times are GMT -5. The time now is 01:36 PM.