7
votes
3answers
616 views

How can a log program continue to log to a deleted file?

From the Unix Power Tools, 3rd Edition: Instead of Removing a File, Empty It section: If an active process has the file open (not uncommon for log files), removing the file and creating a new ...
14
votes
2answers
1k views

How do I “cat and follow” a file?

A file is being sequentially downloaded by wget. If I start unpacking it with cat myfile.tar.bz2 | tar -xj, it may unpack correctly or fail with "Unexpected EOF", depending on what is faster. How to ...
2
votes
0answers
78 views

ls does not show a hidden file (OS X)

I am using lsof to view the list of open files. One such file that it displays open is : Google 3864 malaykeshav 46u REG 1,1 470455334 32578671 ...
3
votes
3answers
60 views

Moving an open file to a different device

I have an application running that is generating a large (~200GB) output file, and takes about 35 hours to run (currently I'm about 12 hours in). The application just opens the file once then keeps it ...
5
votes
3answers
302 views

tail -f, Determine if a file is no longer being written to [closed]

I am using tail -f to follow the growth of a log file. I am having trouble finding a way to detect if the process that is writing to the log file (when it crashes or is otherwise terminated) is no ...
12
votes
3answers
16k views

Find and remove large files that are open but have been deleted

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a ...
2
votes
1answer
124 views

vim not shown in fuser

First use Vim to edit a file, say /tmp/A. Assuming that vim process is the only one that accesses /tmp/A, then use "ctrl+z" to suspend the process, and execute fuser /tmp/A Then you see nothing ...
2
votes
2answers
1k views

File delete versus overwrite and link at /proc/pid/fd

It is well known that UNIX systems won't actually delete a file on disk while the file is in use. So if a file is being accessed by process 1 and process 2 deletes the file using rm, process 1 ...
5
votes
2answers
3k views

How to find out which file is currently written by a process

My situation is that from time to time a specific process (in this case, it's Thunderbird) doesn't react to user input for a minute or so. I found out using iotop that during this time, it writes ...
4
votes
2answers
223 views

Can I move a directory with open files?

Imagine a bunch of processes using a /home/user/logs directory. They have some logs open for a longer time.
14
votes
2answers
3k views

How do open files behave on linux systems?

I just renamed a log file to "foo.log.old", and assumed that the application will start writing a new logfile at "foo.log". I was surprised to discover that it tracked the logfile to its new name, and ...
2
votes
1answer
192 views

Prevent libflashplayer.so from deleting a file?

I'm trying the preview release of Flash Player "Square" for Linux and noticed that video files are now being deleted from the /tmp/ folder. Yet the files are still in use (I can see them with lsof): ...