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)
  • Thanks for the reply! I was interested mainly in how many file that may have the di attribute. If results came back with files, I would run the find command and remove it. I did this back many years ago once before when coming from netware nss to OES. There was a slew of files that had di on them and it was a pain to clear one at a time. I was just going to redirect the find command above to a file the search for the di<space> to see what it finds, but I like your idea better! I'm hoping there are none anyway, Thanks again!
Reply
  • Thanks for the reply! I was interested mainly in how many file that may have the di attribute. If results came back with files, I would run the find command and remove it. I did this back many years ago once before when coming from netware nss to OES. There was a slew of files that had di on them and it was a pain to clear one at a time. I was just going to redirect the find command above to a file the search for the di<space> to see what it finds, but I like your idea better! I'm hoping there are none anyway, Thanks again!
Children