Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

21
votes
2answers
967 views

Is it safe to move a file that's being appended to?

I have a node.js process that uses fs.appendFile to add lines to file.log. Only complete lines of about 40 chars per lines are appended, e.g. calls are like fs.appendFile("start-end"), not 2 calls ...
4
votes
1answer
49 views

How to make sure only one instance accessing the file at a time in a folder?

I have a shell script which will be executed by multiple instances and if an instance accessing a file and doing some operation how can I make sure other instances are not accessing the same file and ...
1
vote
1answer
83 views

Daemon's open file limit is reached even though the system limits have been increased

I am running Debian wheezy. File limits are increased to 100000 for every user. ulimit -a and ulimit -Hn / -Sn show me the right amounts of maximum open file limits even in screen. But for some reason ...
5
votes
2answers
238 views

Why does process substitution result in a file called /dev/fd/63 which is a pipe?

I am trying to understand named pipes in the context of this particular example. I type <(ls -l) in my terminal and get the output as, bash: /dev/fd/63: Permission denied. If I type cat <(ls ...
7
votes
3answers
625 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 ...
13
votes
2answers
808 views

How to find out what process is writing to STDOUT?

I have two instances of a process running. One of them is "frEAkIng oUT!" and printing errors non stop to STDOUT. I want to kill the broken process but I have to make sure I don't terminate the wrong ...
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
100 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
68 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 ...
1
vote
1answer
88 views

Prevent active file removal on an NFS filesystem

I clear my logs using following script - find "." -mtime 1 -type f -print0 | xargs -0 rm -rf But it deletes the active files also and creates .nfsā€¦ files instead. Is there any way to prevent ...
1
vote
1answer
460 views

How to configure the process open file limit of a user?

The default open file limit per process is 1024 on - say - Linux. For certain daemons this is not enough. Thus, the question: How to change the open file limit for a specific user?
5
votes
3answers
371 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 ...
5
votes
2answers
527 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
1
vote
0answers
129 views

Which process is occupying a certain pseudo terminal pts/X?

On Linux: Normally pseudo terminals are allocated one after the other. Today I realized that even after a reboot of my laptop the first opened terminal window (which was always pts/0 earlier) ...
1
vote
1answer
213 views

If I open the same file twice in Okular, switch to the existing window

I have always been confused why the file manager in Linux cannot stop applications from opening a single file twice at the same time? Specifically, I want to stop the PDF file reader Okular from ...
1
vote
1answer
119 views

If file does not get closed, will OS close it?

If a file is being opened by a process and it is not being closed by any of the processes, will the OS automatically close that open file?
0
votes
1answer
87 views

“Open file” dialog: Focus jumps to text field (LMDE / Cinnamon)

I have a usability problem with the "Open file" dialog. The questions would be: Is there any way out? E.g. can I disable the autocomplete? Otherwise, I might post a bug report.. Why does this ...
3
votes
2answers
108 views

File permissions and saving

Let's say you open a file on which you have write permission. Meanwhile you change permissions and remove write permission while you still have the file open in some editor. What will happen if you ...
5
votes
2answers
2k views

What process is accessing a mounted filesystem sporadically?

I have a Solaris 10 server with autofs-mounted home dirs. On one server they are not unmounted after the 10 min timeout period. We've got AUTOMOUNT_TIMEOUT=600 in /etc/default/autofs, I ran automount ...
3
votes
2answers
76 views

Bizarre Disk Use Problem

I have an external hard drive on which I use rsync to backup my home directory. Today, I tried to umount the drive. It said it was busy. So, I used fuser to figure out who was using it: /media/Panp9 ...
1
vote
2answers
81 views

Tracking which files are used by program

I am looking for a way to track which files are used by program installer(InstallAnywhere). I cannot use lsof because as far as I know it works on active processes and I want a tool which will work ...
1
vote
1answer
307 views

Strange behavior in mv command - maybe open sys call issue?

I'm noticing very strange behavior from the "mv" command that may (or may not) be related to the "open" system call. We're running RedHat v5. There are two separate storage devices, one mounted to ...
2
votes
4answers
8k views

Show running processes with file name(s)?

I am using putty to connect my linux server which my sites are in. I can run # ps aux | less to show running processes. But I want to display which files running these processes ? I have also ...
16
votes
3answers
21k 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 ...
3
votes
1answer
139 views

lsof doesn't return files open by the same user

Consider this simple scenario: I open a text file ~/textfile.txt with vim in one terminal (tried with both edit and read-only modes). In a different terminal, I run /usr/sbin/lsof ~/textfile.txt ...
2
votes
1answer
343 views

How can I access a deleted open file on Linux (output of a running crontab task)?

I have an hourly hour-long crontab job running with some mtr (traceroute) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the ...
4
votes
1answer
198 views

Using xdg-open for accessing network with normal explorer

I'm working with small network and I want to start network explorer from a terminal. When I tried to type xdg-open network:///server it opened google chrome and did nothing. I also tried to type ...
13
votes
1answer
3k views

How do I monitor opened files of a process in realtime?

I know I can view the open files of a process using lsof at that moment in time on my Linux machine. However, a process can open, alter and close a file so quickly that I won't be able to see it when ...
2
votes
1answer
133 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
1answer
151 views

Max Open Files, clarification needed

On my machine, ulimit -n returns 2560 Given that -n returns The maximum number of open file descriptors. Does it mean that system won't allow more then 2560 open files to be out there at any ...
5
votes
3answers
2k views

vim: How to switch to the directory listing from file view?

I have opened a dir vim some/dir. I can navigate within the tree, yet once I opened a file I wonder, how do I close the file view in order to go back to the directory listing to navigate to another ...
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 ...
1
vote
0answers
71 views

how to open a knote file on knote

I was wondering if there is any way to open a knote file within knote. There is a knote save option but I am not sure how to open one. Any ideas? Any other program that could open .ics files?
4
votes
2answers
5k views

File descriptor linked to socket or pipe in proc [duplicate]

Possible Duplicate: /proc/PID/fd/X link number i have a question regarding the file descriptors and their linkage in the proc file system. I've observed that if i list the file descriptors ...
3
votes
1answer
144 views

Efficient mechanism to determine if open file has been externally modified?

For example, the IDE I'm using at the moment (Aptana Studio) notifies me as soon as a file's contents it has open have been changed by some external program. I can imagine having a periodic loop run ...
5
votes
1answer
761 views

Which command will open the default browser on a system to a given web page (terminal)?

Title says it all. Is there a way to open the default browser on a user's system to a specific page from within a Bash script, or other-language script?
1
vote
1answer
230 views

What happens if a cron script tries to copy a directory at the same time as another process is writing to it?

For example, if I have a java process that (once every 2 hours) takes a backup of a large file, like 500mb, and places it into folder A on HDD A, and I want to schedule a cron script to copy the ...
19
votes
3answers
16k views

Why is number of open files limited in Linux?

Right now, I know that: Find open files limit per process: ulimit -n Count all opened files by all process: lsof | wc -l Get maximum open files count allowd: cat /proc/sys/fs/file-max My ...
5
votes
1answer
378 views

How can I configure OpenBox session for opening files by mime type?

I've started using OpenBox and I really like it. But my chromium opens everything with firefox. Is there any fix for that? I'm looking for most lightweight solution, but also with easy and fast ...
9
votes
2answers
2k views

How to find out the file offset of an opened file?

My problem is that with lsof -p pid I can find out the list of opened file of a process whose process id is pid. But is there a way to find out the file offset of each accessed file ? Please give me ...
6
votes
2answers
3k views

Change default applications used by gnome-open, exo-open, xdg-open, gvfs-open and kde-open

How to change the applications associated with certain file-types for gnome-open, exo-open, xdg-open, gvfs-open and kde-open? Is there a way by editing config files or by a command-line command? Is ...
5
votes
2answers
542 views

Recover deleted file that is currently being written to

I started downloading a big file and accidently deleted it a while ago. I know how to get its current contents by cping /proc/<pid>/fd/<fd> but since the download is still in progress ...
14
votes
3answers
2k views

Monitor what is being sent to /dev/null?

Just for fun: Is there a way to monitor/capture/dump whatever is being written to /dev/null? On Debian, or FreeBSD, if it matters, any other OS specific solutions are also welcome.
5
votes
2answers
4k 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 ...
23
votes
1answer
20k views

ulimit: difference between hard and soft limits

What is the difference between hard and soft limits in ulimit? For number of open files, I have a soft limit of 1024 and a hard limit of 10240. It is possible to run programs opening more than 1024 ...
3
votes
2answers
410 views

Capturing new output after deleting the output file

I'm runnig a java server on Debian with this command: java -jar myapp.jar [args] >> log.txt Once I gzipped the log file to send it and then I realized the original file was gone, leaving me ...
4
votes
2answers
258 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.
9
votes
4answers
3k views

How can same fd in different processes point to the same file?

Say I have process 1 and process 2. Both have a file descriptor corresponding to the integer 4. In each process however the file descriptor 4 points to a totally different file in the Open File Table ...
1
vote
2answers
289 views

display sco unix 5.0.6 samba usage

Is there a command on sco unix which will show which files are being accessed by the samba process ? Something like lsof in linux maybe, or similar.
13
votes
3answers
1k views

Where do open file handles go when they die?

What happens to the files that are deleted while they have a file handle open to them? I have been wondering this ever since I figured out I could delete a video file while it was playing in MPlayer ...