I can't find a shell command to remove all the FIFO files inside a directory. In fact, for the removal of directories, the rm command offers the options -d, --dir, but for FIFOs it offers no option.

For now, the only workaround found is to call the FIFO like foo.fifo so that it is easy to remove them with rm *.fifo.


To delete all FIFOs in the current directory and all sub-folders use

find . -type p -delete

To delete FIFOs only in the current directory use

find .  -maxdepth 1 -type p -delete

shell only for current directory...

set -- ./*
for f do
    [ -p "$f" ] && rm "$f"

Try this:

find -maxdepth 1 -type p -exec rm {} \;

Manpage of find:

-type c
      File is of type c:

      p      named pipe (FIFO)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.