Identifying the user/process that has a file open
So you've got this file the you want to delete, but the system keeps telling you it's locked or in use. But who, what is using that file?
To identify the user of a file, along with the process number that has the file open, run "fuser -u filename". For example, you could run "fuser -u /bin/bash" to see who has the bash executable in use (probably you) along with the process number. Kill the process using a "kill -9 " where is the process id number.