Linux / UNIX List Open Files for Process

Linux / UNIX List Open Files for Process

Linux / UNIX List Open Files for Process. Explains how to get a list of open files for a UNIX / Linux process using command line options and commands.

How do I list all open files for a Linux or UNIX process using command line options? How can I show open files per process under Linux?

Both Linux and Unix-like operating systems come with various utilities to find out open files associated with the process.

UNIX List Open Files For Process

First use the ps command command to get PID of process, enter:

$ ps -aef | grep {process-name}

$ ps -aef | grep httpd

Next pass this PID to pfiles command,

$ pfiles {PID}

$ pfiles 3533

See pfiles command documentation for more information

FreeBSD list open files per process

On FreeBSD use the fstat command along with the ps command:

## ps aux | grep -i openvpn ``## filter outputs using the ``[grep command](https://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/)`` #

## fstat -p {PID}

## fstat -p 1219

linux / unix

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Dedicated Linux Developer

Looking to develop real-time applications? **[Hire Dedicated Linux Developer](https://hourlydeveloper.io/hire-dedicated-linux-developer/ "Hire Dedicated Linux Developer")** from **[HourlyDeveloper.io](https://hourlydeveloper.io/...

How I Switched from Windows 10 to Linux Mint

This article is all about my journey on switching from Windows 10 to Linux Mint 20, how I got easily adapted to the Linux environment, and some resources that helped me to set up a perfect Desktop environment.

User Administration in Linux - Linux Tutorial - Linux Training

User Administration in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

Linux / UNIX Delete a File

Learn how to delete/remove a file and directory under a Linux or Unix-like like operating systems using the rm or unlink command line option.