Get file properties via dbus command

Thomas Kluyver thomas at kluyver.me.uk
Fri Jun 23 09:53:28 UTC 2023


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20230623/1f0bbf9e/attachment.htm>


More information about the dbus mailing list