Use of the attrib command OES2015

I was hoping someone new how to list files with a certain attribute (di or delete inhibit) on an nss volume. I know how to remove them from an article here https://www.zerowizard.com/?cat=16

Not sure how to set a find up using attrib and list or grep out just files that have the di attribute. Any of you command line experts know?

Thanks in advance!

Parents
  • Verified Answer

    For all files with "delete inhibit":

     attrib [path]/* -r | grep "di "
    • attrib → By itself will simply output the file name and the assigned attributes
    • -r → Recursive, so it will travel down the directory structure
    • | grep "di " → Pipes output over to grep in order to pull out the ones you want. Note the additional space in "di ". This will match any file with the "delete inhibit" attribute

    The output only lists the file name, not the directory, as seen in the following output:

    # attrib /media/nss/USER/BenjaminH/* -r | grep "di "
    ar di aa (db.benjaminh.local)(zid:2885281)
    ar di aa (prefs.js)(zid:134791)
Reply
  • Verified Answer

    For all files with "delete inhibit":

     attrib [path]/* -r | grep "di "
    • attrib → By itself will simply output the file name and the assigned attributes
    • -r → Recursive, so it will travel down the directory structure
    • | grep "di " → Pipes output over to grep in order to pull out the ones you want. Note the additional space in "di ". This will match any file with the "delete inhibit" attribute

    The output only lists the file name, not the directory, as seen in the following output:

    # attrib /media/nss/USER/BenjaminH/* -r | grep "di "
    ar di aa (db.benjaminh.local)(zid:2885281)
    ar di aa (prefs.js)(zid:134791)
Children