Score:3

How to remove file attributes?

cn flag

The Arch Linux version of gio has a set command that has a -d option to remove an attribute: https://man.archlinux.org/man/gio.1

But this set command delete option did not work when I tried it in Ubuntu. And the Ubuntu manual does not list this option, or any other option, to remove an attribute using the set command: https://manpages.ubuntu.com/manpages/jammy/en/man1/gio.1.html

So how are attributes removed in Ubuntu?

The commands that did not work are:

gio set -d "/home/stephen/Desktop/Flameshot.desktop" "metadata::gedit-encoding"
gio set -d "/home/stephen/Desktop/Flameshot.desktop" "metadata::gedit-position"
gio set -d "/home/stephen/Desktop/Flameshot.desktop" "metadata::gedit-spell-language"
gio set -d "/home/stephen/Desktop/Flameshot.desktop" "metadata::nautilus-drop-position"
gio set -d "/home/stephen/Desktop/Flameshot.desktop" "metadata::nautilus-icon-position"

The response to each of them is this error:

gio: Unknown option -d
user535733 avatar
cn flag
I see different versions here. Have you looked for changelogs? Or the different patches that Debian and Arch apply during build and packaging?
user10489 avatar
in flag
What exact command line are you trying?
Stephen avatar
cn flag
To answer your question I edited in the commands you asked for to my original question.
Score:0
cn flag

Following your examples, you can use

gio set --type=unset "/home/stephen/Desktop/Flameshot.desktop" "metadata::gedit-encoding"

According to the Arch Linux man page you linked in your question

-d, --delete
   Unsets an attribute (same as setting it's type to unset).

does the same as --type=unset.

Stephen avatar
cn flag
This worked, thank you. What worked is `gio set --type=unset` . What did not work is `gio set -t=unset` , which as far as I can see should have. But what matters is I have a way that works. :)
mook765 avatar
cn flag
@Stephen You should try `-t unset`, this way other commands handle it for the short option. Example from `man grep`: `-f FILE, --file=FILE`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.