Questions tagged [open-files]

Dealing with files that are currently opened in a program

Filter by
Sorted by
Tagged with
0
votes
1answer
49 views

How can we count/list all files opened by a specific program/COMMAND? [duplicate]

We can list only files opened by a specific PID as lsof -p 1000 lsof -p 1000 | wc -l How can we list/count the files opened by a specific program/COMMAND (e.g., java)? And so much better, if we can ...
1
vote
1answer
38 views

how to verify current open files on specific service

on our rhel server 7.6 version we have the following systemctl service /etc/systemd/system/test-infra.service and the value of LimitNOFILE is systemctl show test-infra.service | grep LimitNOFILE ...
-1
votes
1answer
38 views

Locking a file to (over)writing [closed]

I have a poorly designed build script that always overwrites files that it shouldn't; if I edit these files and then run the script, it overwrites their content and, thus, the build fails. How can I &...
0
votes
0answers
29 views

open with … causes one program to appear multiple times

I have a: fresh installation of Linux mint 20 cinnamon a week ago (luv it) and i have 3d ays ago installed okular for pdfs. My Problem: when i want to open a file, that is unknown to the system with ...
1
vote
1answer
71 views

Help solving an elusive file descriptor leak

Over the last 6 months I've been facing an issue I can't seem to get rid of: apparently random "too many files open" / "can't open TCP/IP socket (24)" / "getaddrinfo: can't ...
1
vote
1answer
33 views

Is it possible to read a .sh that was deleted from file system but is being executed? [duplicate]

I've received a project that some dude did and it's on production stage. But that guy had some issues with project managers and other team members (bad attitude, being an ass.. etc). Intentionally he ...
1
vote
0answers
29 views

Copy a file with zero links but still open in some process

I like to copy this file: # lsof +L -p XXX Anime4KCP 78674 evar 14w REG 1,6 101187628 0 8682526126 /Users/evar/Base/_Code/Misc/Anime4KCPP/bin/output/...
-1
votes
1answer
188 views

how to know if we reached the max value of fs.file-max

On our Linux RHEL servers fs.file-max is set to 100000 sysctl -p | grep fs.file-max fs.file-max = 100000 From my understanding the file-max kernel parameter refers to open file descriptors, and file-...
0
votes
2answers
64 views

when clicking open folder the system launches VSCode

Hi everybody I want to start to say thank you for your time! I have a problem and don't really know what to do to solve the problem. When i download something and I click on the arrow in Firefox to ...
1
vote
1answer
2k views

Is it possible to force ending of (close wait) connections?

when we run lsof on port 6060 as the following # lsof -i TCP:6060 | more COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME app_lot 3495 root 12u IPv6 9238779 1t0 TCP *:krb0934 (...
0
votes
0answers
88 views

lsof show number of open files that are more then what configured [duplicate]

we verify the file max as [root@linux02 ~]# cat /proc/sys/fs/file-max 500000 but when we run lsof we get [root@linux02 ~]# lsof | wc -l lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/...
9
votes
1answer
188 views

List of busiest files

I'm looking for a tool which will list open files sorted by amount of activity in the file. So lsof does not do the job (unless I'm overlooking a way to use lsof). Ideally, the tool should work like ...
1
vote
5answers
396 views

Stop program from writing to a deleted file

One of our systems has a growing log file (we will be addressing) but currently the application owner will delete the file with rm then wait for the next maintenance window to reboot. I find myself ...
0
votes
1answer
951 views

Open file limits not increased for redis user despite change in /etc/security/limits.conf

I got ERR max number of clients reached from my redis server so I decidied to increase the allowed max client connections in its configuration. This also requires according to the documentation, ...
0
votes
2answers
39 views

Find out which process has data open on the hard drive that is no longer visible in the directory tree [duplicate]

On my server, the root partition is 73GB, but the disk says, it is full, although there are only about 6GB used on that device: # df -h Filesystem Size Used Avail Use% Mounted on ...
0
votes
1answer
9k views

How to access USB disk from terminal

I have few files in a USB disk named F:. I The files inside it are large. I do not want to move them to my harddisk. I want to make some comparison, e.g. diff between files from inside the USB and in ...
1
vote
2answers
755 views

Is a file descriptor ever NOT open?

Of course a file can be open, or not open. However, a file descriptor by definition refers to an open file (right?). (Well, except when it refers to something besides a file, like a pipe or what ...
7
votes
1answer
7k views

ulimit vs file-max

Could someone explain limit on open files in linux? The problem is that one of my applications if reporting "Too many open files". I have ulimit -n 1024 but cat /proc/sys/fs/file-max 6578523 and ...
0
votes
0answers
58 views

How can I always bring the application to front when opening a new file?

Running in a GNOME 3.28.0/Wayland desktop. If I right-click on a text file and select "Open with other application", the application I choose is brought to the front when it launches. However, if I ...
4
votes
1answer
8k views

Increase number of open files in mac high sierra [duplicate]

On a mac high sierra 10.13.3 I have 256 open files. I want to raise it and I open a terminal and enter sudo launchctl limit maxfiles 1000000 1000000 This doesnt change anything when I enter ulimit ...
7
votes
1answer
9k views

How to increase the maximum number of open files on Fedora?

I want to increase the maximum number of open files in Fedora 27, since the default settings are too low: $ ulimit -Sn 1024 $ ulimit -Hn 4096 First, I ensure that the system-wide setting is high ...
12
votes
3answers
2k views

Tools for showing which files are accessed by a program?

I'm not going for complicated tools like AppArmor complain mode, I need easy tools to tell me which files are accessed by a specific program.
0
votes
1answer
2k views

How can a process have a higher open file descriptors limit than that set by the hard limit?

I am using Solaris 11 and it is my understanding that a non-privileged user can increase or decrease the soft limit of maximum open file descriptors while staying within the hard limit. It is also ...
0
votes
1answer
2k views

How to increase open files limit for a specific user?

Currently we have below entry in /etc/security/limits.conf * hard nofile 65000 I want to increase that limit for a specific user called oracle, so if I add a line below like oracle hard nofile ...
0
votes
1answer
1k views

RHEL setting a user specific max number of open files

I've set up below values in /etc/security/limits.conf in my RHEL machine. * hard nofile 65535 @student hard nofile 100000 Is this the correct approach when setting a user specific max number of ...
7
votes
4answers
19k views

How to list all the current network connections for a given PID?

If I have a PID, how can I then find all the connections that are open for that process? I have tried with netstat | grep $PID but this does not seem to work. I need a command that will take that ...
1
vote
1answer
3k views

How to access the output of a process after the terminal was closed [duplicate]

I started an application from the terminal which prints the status and various logs in the console so that I can read them from the terminal. I accidentally closed the terminal but the application is ...
5
votes
2answers
1k views

Grab standard input/ouput of a running process under FreeBSD/macOS

Under Linux I often use /proc/<pid>/fd/[0,1,2] to access std[in,out,err] of any running process. Is there a way to achieve the same result under FreeBSD and/or macOS ?
1
vote
2answers
1k views

Why xterm doesn't have /dev/ptmx file opened?

gnome-terminal have the /dev/ptmx file opened: But xterm doesn't have it opened: I thought that each terminal emulator must have the /dev/ptmx file opened, so why xterm doesn't have it opened? Edit:...
5
votes
1answer
808 views

Identify a process that is still using a file on a lazy-unmounted filesystem

I have a /dev/md127 mdadm RAID 0 array that some time ago was mounted as /mnt/storage1. At some point I opened a bash session and changed CWD to /mnt/storage1 and the bash session is still active. I ...
1
vote
2answers
682 views

When is a file freed in an ext file system?

Introduction Until recently, I thought that on ext file system, inodes have reference counters which count the number of times the file is referenced by a directory entry or a file descriptor. Then, ...
5
votes
2answers
3k views

How to recover the deleted binary executable file of a running process

I have a process running very long time. I accidentally deleted the binary executable file of the process. Since the process is still running and doesn't get affected, there must be the original ...
2
votes
3answers
4k views

Does killing a process close all files opened by that process?

I want to kill a process which has an open connection to a database. If I kill the process, can I make sure that the database is unlocked?
11
votes
5answers
16k views

Largest allowed maximum number of open files in Linux

Is there a (technical or practical) limit to how large you can configure the maximum number of open files in Linux? Are there some adverse effects if you configure it to a very large number (say 1-...
43
votes
4answers
96k views

How to list the open file descriptors (and the files they refer to) in my current bash session

I am running in an interactive bash session. I have created some file descriptors, using exec, and I would like to list what is the current status of my bash session. Is there a way to list the ...
1
vote
1answer
862 views

How to make open files limits more than 2000000?

/etc/security/limits.conf contains * soft nofile 2000000 * hard nofile 2000000 After I changed the open files limits to 2000000, the system can't login; error message is "permission denied". If I ...
0
votes
0answers
431 views

Intercept GNU/Linux system calls

Context I am trying to design a tool that would more or less automatically generate a Makefile from a standard shell script. The idea would be that for each command executed by the script: I ...
4
votes
1answer
1k views

Is it possible to find which vim/tmux has my file open?

I use tmux at work as my IDE. I also run vim in a variety of tmux panes and will fairly often background the process (or alternatively I just close the window - I have vim configured not to remove ...
2
votes
1answer
2k views

Are all open files displayed in lsof output?

In all the cases, I have found any file which is open for reading or writing is displayed in lsof output. But today, I am trying to found a logfile that is opened for writing by a java process in lsof ...
7
votes
1answer
12k views

How to find processes using serial port

I'm using uclinux and I want to find out which processes are using the serial port. The problem is that I have no lsof or fuser. Is there any other way I can get this information?
0
votes
2answers
749 views

Will the execution of the binaries that is sitting on a mounted NFS directory fails when network interruption happen?

So I have a Linux machine that acts as an NFS server. Lots of programs has been installed to the folder that is being exported. On another Linux machine, I've been running one of the program that is ...
4
votes
1answer
5k views

How to get number of opened file descriptors for user

I know about lsof and ls /proc/*/fd but none of them are atomic AFAIK. Because in the latter case I would need to get all pids for user and then filter by them and by that time some of the file ...
4
votes
2answers
410 views

Identify files/processes that prevent remounting read-only

My system runs Debian Testing, and / is generally mounted as read-only. The main problem with this is, every time I install something or update the system, I cannot remount the filesystem (I get the ...
2
votes
1answer
2k views

Why lsof reports a higher number of open files of user than what ulimit says should be allowed?

I have checked the result for user kpiserv [kpiserv@***** ~]$ lsof -u kpiserv |wc -l 5358 [kpiserv@***** ~]$ ulimit -a open files (-n) 1024 Why lsof reports a higher ...
3
votes
2answers
7k views

Finding Process Info Associated to a Given Port in HP-UX

I need to find information for a process that's using a given port number, such as 8080. More specifically, I'm interested in finding out the full path of the program. How can I do that in HP-UX?
20
votes
2answers
22k views

Read “/proc” to know if a process has opened a port

I need to know if a process with a given PID as opened a port without using external commands. I must then use the /proc filesystem. I can read the /proc/$PID/net/tcp file for example and get ...
3
votes
1answer
457 views

Can file handles be translated to filenames?

Is there a tool for translating file handles to file names on Solaris 10? I've looked around and found several scripts including the one at: http://heim.ifi.uio.no/kjetilho/hacks/fhfind.perl https://...
3
votes
0answers
4k views

“Too many open files ssh” when the number of open files is far below ulimit

I was trying to set up 2000 concurrent ssh connections, but got the error message in server log (i.e. journalctl): sshd[1356]: error: reexec socketpair: Too many open files I've set both the soft ...
13
votes
4answers
2k views

`ls` error when directory is deleted

I have two shells open. The first is in directory A. In the second, I remove directory A, and then recreate it. When I go back to the first shell, and type ls, the output is: ls: cannot open ...
30
votes
6answers
138k views

Best way to free disk space from deleted files that are held open

Hi I have many files that have been deleted but for some reason the disk space associated with the deleted files is unable to be utilized until I explicitly kill the process for the file taking the ...