Re: Get file properties via dbus command

"Thomas Kluyver" <[email protected]> Fri, 23 Jun 2023 10:53:28 +0100
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
On Fri, 23 Jun 2023, at 10:14, Ahmad Ismail wrote:
> Suppose I have file like /home/ismail/Desktop/file.txt or, file:///home/ismail/Desktop/file.txt
> 
> I want to see it's properties using cli.
> 
> What command shall I use?
Something like this will work:

dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItemProperties array:string:"file:///home/ismail/Desktop/file.txt" string:""

But like Lawrence said, it may not do what you want. This asks your file manager to show its 'file properties' window; it doesn't give the information back in the terminal. If you want to show or use the information inside the terminal, you probably don't want to use D-Bus.

Thomas