Imagine you have downloaded a file from a website or especially a Google Drive shared folder, and when you select the same file on your local Macintosh HD and use the ‘Command + I’ command on your Mac’s Keyboard, what you see is a long list of gibberish URL the file you downloaded from under ‘Where from’ section.
It looks something like this:
Now, you may ask how to remove this Where from section gibberish from your file or all files inside the folder. The answer follows these simple steps.
To remove specific ‘Where from’ attributes from the file:
Use the ‘xattr’ command with the ‘-d’ flag and then describe the command to delete specific attributes. Here is ‘Where from’.
xattr -d com.apple.metadata:kMDItemWhereFroms filename.txt
To remove all extended attributes from the single file:
Use the ‘xattr’ command with the ‘-c’ flag to clear all the attributes.
xattr -c filename.txt
To Remove All Extended Attributes from All files inside one folder:
To recursively remove extended attributes on all files in a directory, combine the ‘-c’ clear flag with the ‘-r’ recursive flag:
xattr -rc /path/to/directory
Important Note:
If you have a long path with spaces or special characters, you can use this trick. Open the Terminal app and start typing xattr -rc, including a trailing space. Then, drag the file or folder to the Terminal app window. It will automatically add the full path.
Note: I have referred to this post from stack overflow to solve the above problem.
I hope this information helps you to complete your task.
Thanks & Regards
Mandar Apte