Skip to content

Instantly share code, notes, and snippets.

@nicc777
Created May 17, 2023 11:31
Show Gist options
  • Save nicc777/5260c90c9e88e6fff69dc46fbe739766 to your computer and use it in GitHub Desktop.
Save nicc777/5260c90c9e88e6fff69dc46fbe739766 to your computer and use it in GitHub Desktop.
Linux: Identify all files in a directory not currently open by an application
#!/bin/bash
for f in *; do
fuser -s "$f" || echo "$f" >> /tmp/files
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment