The man page for
ls
(in Terminal.app, type
ls
, right click the word "ls", and select "Open man Page") says that the
+
character indicates an ACL (Access Control List).
The man page says the
-e
option will show the ACL.
Code:
cd ~
ls -l | grep +
ls -lde Documents Movies Music Pictures Sites
The
-d
option will list a directory without listing its contents (treats arguments as files)
I would try researching commands to modify ACL (if necessary) - I guess check the man page for
chmod
One thing you can do is paste the icon to a new folder, then use commands to move the icon to the destination folder. Say the folder is
~/MyFolderWithCustomIcon
and you want to copy its icon to
~/Documents
:
Code:
setfinderinfoflag () {
local thepath="$1"
local thechar="$2"
local thebit="$3"
local thevalue="$4"
local thefinderinfo=""
local newfinderinfo=""
local thedescription=""
thefinderinfo=$(xattr -px com.apple.FinderInfo "$thepath" 2> /dev/null | xxd -p -r | xxd -p -c 32)
if [[ -z "$thefinderinfo" ]]; then
thefinderinfo="0000000000000000000000000000000000000000000000000000000000000000"
thedescription="nonexistant "
fi
newfinderinfo=${thefinderinfo:0:$thechar}$( printf "%x" $(( ${thefinderinfo:$thechar:1} & (~(1<<(thebit))) | (thevalue<<(thebit)) )) )${thefinderinfo:$((thechar+1))}
if [[ "$newfinderinfo" != "$thefinderinfo" ]]; then
echo "# modifying ${thedescription}FinderInfo $newfinderinfo $thepath"
xattr -wx com.apple.FinderInfo "$newfinderinfo" "$thepath"
else
echo "# unchanged ${thedescription}FinderInfo $newfinderinfo $thepath"
fi
}
setfoldercustomicon () {
setfinderinfoflag "$1" 17 2 1
}
cp ~/MyFolderWithCustomIcon/Icon$'\r' ~/Documents
setfoldercustomicon ~/Documents
$'\r'
is a carriage return character (ASCII 0x0D = 13 = Control-M) - Apple uses this for files that it doesn't want the user to mess with because it's difficult to enter a file name that includes a carriage return character in the UI. The Finder shows the character as
?
(if you've enabled showing invisible files with Command-Shift-Period). The Icon$'\r' file uses a resource fork (accessible as one of the extended attributes) to store icons (either
icns
or older icon resource types which can be listed with
derez
). The root folder of a volume uses a file named
.VolumeIcon.icns
which uses a different format for the icon (the icns is in the data fork as an icns icon type instead of the resource fork).