Skip to content

lsof -F p prints more than just pid #103

@po5857

Description

@po5857

In earlier versions of lsof, -F p printed only the pid:

$ sudo lsof -i tcp:22 -s tcp:LISTEN -F p
p677
$ rpm -q lsof
lsof-4.87-6.el7.x86_64

Newer versions print filehandles also, which breaks scripts parsing this output:

$ sudo lsof -i tcp:22 -s tcp:LISTEN -F p
p609
f5
f6
$ rpm -q lsof
lsof-4.93.2-3.fc32.x86_64

Is this behavior change intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions