.bashrc files modifying the PS1 variable?

Is there a command for finding all files on the system named ".bashrc" that modify the PS1 variable? I'd like to list the full file name(s) and the protection (including the full path).

...please...?

ls -l $(grep -l PS1= $(find / -name .bashrc))

With all due respect, wempy's code will work but is a bit "heavy". Using find here is usually better:

find / -type f -name .bashrc -exec grep -l PS1= "{}" ";"

Since one would only expect .bashrc's do be in directories like /home/xxx/.bashrc, you can make the search faster with:

for home in /home/*; do
  test -f $home/.bashrc && grep -l PS1= $home/.bashrc
done

If you have users spread throughout the filesystem, for some strange reason, you can use getent to get all home directories:

getent passwd |awk -F: '{ print $6 }' |
while read home; do
  test -f $home/.bashrc && grep -l PS1= $home/.bashrc
done

Hmm, I thought that I had limited the number of processes that are started here by using my method.

ls -l $(grep -l PS1= $(find / -name .bashrc))

starts only 3 processes (1 ls, 1 grep and 1 find), whereas yours will start 1 find and any number of grep processes depending on how many files find, er, finds.
I'm not disagreeing with you though that the place to look would be under home, and to only explicitly search in the root of the users home directories.

You have a good point, especially if the number of users is greater than 2 (and it usually is). However, in my defense, it's to be expected that the number of .bashrc files are relatively small compared to the overall execution time of the find. Also, in a very very large user-base, and in cases where directory names have funny characters (like spaces), the $() solution may produce unexpected or incorrect results.

My solution could also be made better with xargs.