Questions tagged [open-files]

Dealing with files that are currently opened in a program

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

Too many open files error, but only when accessing through a mounted disk

I am having a problem where once I try to copy something from a mounted unit on a windows dfs server (Windows server 2012), I get the "Too many open files" errors from linux, but ONLY if I ...
user avatar
1 vote
0 answers
24 views

How to find all the unclosed files of a process?

I'm trying to debug if my app keeps opened files somewhere in the code. I thought of using strace for that but all of the previous topics (like this one) were talking about only opened files. While ...
user avatar
  • 63
0 votes
1 answer
34 views

are there any limit in increase number of openfile in linux?

i want to increase the number of openfile, and on google there are so many ex about it, but there are plenty of number too. so, are there any limit in increase number of openfile in linux?
user avatar
0 votes
2 answers
97 views

Are there "non-standard" streams in Linux/Unix?

The so-called "standard streams" in Linux are stdin,stdout,stderr. But they must be called "standard" for a reason. Are there non-standard streams? And are these non-standard ...
user avatar
  • 121
3 votes
1 answer
39 views

While working on a file in a gui application, how to quickly open the parent directory of a file in the file browser?

I am coming fro MacOS system, and in that system I am addicted to one specific function: while working with (almost) any file, in (almost) any application, I can click in the title bar of the window ...
user avatar
  • 229
1 vote
1 answer
52 views

what is the meaning of backslash in /etc/security/limits.conf

/etc/security/limits.conf looks like this #<domain> <type> <item> <value> # #* soft core 0 #* hard rss ...
user avatar
  • 10.9k
-2 votes
1 answer
67 views

Is there a comprehensive list of all the ways to view a file's contents in linux? [closed]

Is there a comprehensive list of all the ways to view a file's contents in linux, including both methods like cat as well as methods like whiptail where it isn't the reason it was created for? I know ...
user avatar
1 vote
1 answer
151 views

How to open and read a character device as binary file?

I'm working with USB and I want to read the content of usb device descriptor in /dev/bus/usb/00x/00y - it is a character device. I used fopen to open it as a binary file with "rb" parameter. ...
user avatar
3 votes
0 answers
90 views

Calculating MAX NOFILE and MAX NPROC on Linux Servers

Is there any formula or basis that we can consider to calculate hard and soft limits for NPROC and NOFILE? My system is currently using 4096 for NOFILE which is the default value, and we recently had ...
user avatar
-4 votes
1 answer
120 views

Linux 'lsof' command return large value

I'm using a linux server with tomcat 9.0.24. When I stop the tomcat server, following output will return for 'lsof | wc -l' command fdmt@fdm-3-136 apache-tomcat-9.0.24]$ lsof | wc -l 1203 fdmt@fdm-3-...
user avatar
0 votes
1 answer
446 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 ...
user avatar
  • 1,663
1 vote
1 answer
327 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 ...
user avatar
  • 10.9k
-1 votes
1 answer
73 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 &...
user avatar
  • 885
1 vote
0 answers
80 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 ...
user avatar
  • 26
1 vote
1 answer
473 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 ...
user avatar
  • 111
1 vote
1 answer
39 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 ...
user avatar
  • 111
1 vote
0 answers
35 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/...
user avatar
  • 1,287
-1 votes
1 answer
869 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-...
user avatar
  • 10.9k
1 vote
2 answers
585 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 ...
user avatar
  • 111
1 vote
1 answer
4k 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 (...
user avatar
  • 10.9k
0 votes
0 answers
152 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/...
user avatar
  • 10.9k
9 votes
1 answer
233 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 ...
user avatar
1 vote
5 answers
594 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 ...
user avatar
  • 183
0 votes
1 answer
1k 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, ...
user avatar
  • 2,195
0 votes
2 answers
45 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 ...
user avatar
  • 24.6k
3 votes
1 answer
13k 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 ...
user avatar
  • 191
1 vote
2 answers
998 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 ...
user avatar
  • 33.5k
9 votes
1 answer
10k 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 ...
user avatar
  • 229
0 votes
0 answers
123 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 ...
user avatar
  • 2,495
5 votes
1 answer
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 ...
user avatar
  • 253
9 votes
1 answer
10k 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 ...
user avatar
12 votes
3 answers
3k 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.
user avatar
  • 157
0 votes
1 answer
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 ...
user avatar
  • 511
1 vote
1 answer
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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
  • 101
7 votes
4 answers
28k 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 ...
user avatar
  • 71
2 votes
1 answer
4k 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 ...
user avatar
5 votes
2 answers
2k 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 ?
user avatar
  • 1,073
1 vote
2 answers
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:...
user avatar
  • 1,153
5 votes
1 answer
1k 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 ...
user avatar
  • 497
1 vote
2 answers
1k 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, ...
user avatar
  • 2,935
7 votes
2 answers
4k 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 ...
user avatar
  • 643
2 votes
3 answers
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?
user avatar
  • 387
13 votes
5 answers
23k 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-...
user avatar
  • 267
59 votes
5 answers
139k 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 ...
user avatar
  • 988
1 vote
1 answer
1k 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 ...
user avatar
  • 11
0 votes
0 answers
494 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 ...
user avatar
  • 223
5 votes
2 answers
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 ...
user avatar
3 votes
1 answer
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 ...
user avatar
  • 693
11 votes
1 answer
16k 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?
user avatar