Notes and emblems are stored in ~/.local/share/gvfs-metadata/ or (for older versions (2008-ish) of Ubuntu) ~/.nautilus/metafiles/ in binary format.
Regarding emblems. Have a look at this answer: How to change the icons of multiple files from terminal?
Regarding notes. From CRC OK weblog:
Notes are not embedded into the file. You cannot back the files up in an archive without losing the notes, neither can you copy them to an external storage, nor you can even freely move the files around in the same logical disk. You lose notes added to documents if you move them from one user account to another.
That website also has a script to backup notes to 1 file per note with a .ntext extension:
#!/bin/bash
process_dir() {
local -a subdirs=()
echo "Scanning directory: $1"
Scan the directory, processing files and collecting subdirs
for file in "$1"/*; do
if [[ -f "$file" ]]; then
echo "Processing file: $file"
actually deal with the file here...
#gvfs-info $file | grep annotation | sed s/' metadata::annotation: '/''/g > $file.note
note=$(gvfs-info "$file" | grep annotation | sed s/' metadata::annotation: '/''/g)
#len=echo ${#note}
#echo $len
if [ -z "$note" ]
then
echo "No note for file $file"
else
echo "Found a note for file "$file", saying: "$note""
echo "$note" > $file.ntext
fi # $String is null.
elif [[ -d "$file" ]]; then
subdirs+=("$file")
If you don't care about processing all files before subfolders, just do:
process_dir "$file"
fi
done
Now go through the subdirs
for d in "${subdirs[@]}"; do
process_dir "$d"
done
}
clear
if [[ -z "$1" ]]; then
read -p "Please enter a directory for me to scan " dir
else
dir="$1"
fi
process_dir "$dir"
usage of script at your own risc
You start the script like:
./extract_notes /home/rinzwind/
and it will scan /home/rinzwind/ for files containing notes and will result in a filename ending on .ntext in that directory.
Getting them back into files you copy...
gvfs-set-attribute -t string rinzwind.txt metadata::annotation "hello Achu"
gvfs-info -a metadata::annotation rinzwind.txt
attributes:
metadata::annotation: hello Achu

gvfs-info and gvfs-set-attribute are part of gvfs-bin 