Post History
#!/bin/sh export LC_ALL=C # to make sorting not depend on locale # Ignore some well-known directories with many files find_args=' -path /usr/lib/modules -o -path /etc/ssl/certs -o -path ...
Answer
#2: Post edited
```- #!/bin/sh
- export LC_ALL=C # to make sorting not depend on locale
- # Ignore some well-known directories with many files
- find_args='
- -path /usr/lib/modules
- -o -path /etc/ssl/certs
- -o -path /etc/ca-certificates/extracted
- '
- # Get all files and directories
- find /etc /opt /usr \( $find_args \) -prune -o -print | sort > /tmp/all_files
- # Get files and directories known to pacman, removing trailing slashes
- pacman -Qlq | sed 's,/$,,' | sort > /tmp/pacman_controlled_files
- # List files and directories not known to pacman
- comm -23 /tmp/all_files /tmp/pacman_controlled_files
- ```
- ```sh
- #!/bin/sh
- export LC_ALL=C # to make sorting not depend on locale
- # Ignore some well-known directories with many files
- find_args='
- -path /usr/lib/modules
- -o -path /etc/ssl/certs
- -o -path /etc/ca-certificates/extracted
- '
- # Get all files and directories
- find /etc /opt /usr \( $find_args \) -prune -o -print | sort > /tmp/all_files
- # Get files and directories known to pacman, removing trailing slashes
- pacman -Qlq | sed 's,/$,,' | sort > /tmp/pacman_controlled_files
- # List files and directories not known to pacman
- comm -23 /tmp/all_files /tmp/pacman_controlled_files
- ```
#1: Initial revision
``` #!/bin/sh export LC_ALL=C # to make sorting not depend on locale # Ignore some well-known directories with many files find_args=' -path /usr/lib/modules -o -path /etc/ssl/certs -o -path /etc/ca-certificates/extracted ' # Get all files and directories find /etc /opt /usr \( $find_args \) -prune -o -print | sort > /tmp/all_files # Get files and directories known to pacman, removing trailing slashes pacman -Qlq | sed 's,/$,,' | sort > /tmp/pacman_controlled_files # List files and directories not known to pacman comm -23 /tmp/all_files /tmp/pacman_controlled_files ```