LinuxCommandLibrary

gvfs-ls

List files on GVFS volumes

SYNOPSIS

gvfs-ls [OPTIONS...] [LOCATION...]

PARAMETERS

LOCATION
    The location to list. This should be a GVFS URI (e.g., 'sftp://user@host/path'). If no location is specified, the current GVFS directory is listed.

-l, --long
    Show detailed information (like permissions, size, and modification time).

-d, --directory
    List directories themselves, not their contents.

-a, --all
    Show hidden files (files starting with a dot).

-h, --human-readable
    When used with -l, print sizes in human readable format (e.g., 1K 234M 2G).

--help
    Show help options.

--version
    Show the version of the gvfs libraries.

DESCRIPTION

The gvfs-ls command is a command-line tool used to list files and directories within a GNOME Virtual File System (GVFS) location. GVFS provides a virtual filesystem layer allowing applications to access resources using URI-like paths, independent of the underlying protocol or implementation. gvfs-ls allows users to interact with these locations (e.g., network shares, mounted devices) from the terminal, enabling scripting, automation, and detailed inspection of GVFS-accessible resources.

Unlike the standard ls command, gvfs-ls specifically interacts with GVFS. It enables listing contents of remote filesystems such as SFTP, WebDAV, SMB, and cloud storage services if they are mounted by GVFS. Therefore it is useful to have a way to list remote filesystems.

Note that gvfs-ls relies on the GVFS daemon (gvfsd) to be running. It also relies on correct mounting of the remote locations to GVFS so that gvfs-ls can access the files. If the GVFS daemon isn't running, gvfs-ls will typically return an error. When dealing with GVFS mount locations it is important to understand that filesystem operations may not be immediate.

Without arguments, gvfs-ls lists the current GVFS directory. gvfs-ls is a useful tool for inspecting and managing files across various storage locations integrated through the GVFS framework.

CAVEATS

GVFS relies on the gvfsd daemon. If gvfsd is not running, gvfs-ls will not work. Also, GVFS operations might be asynchronous, so file operations might not be immediate. The access permissions depend on the underlying filesystem, so it is possible that GVFS provides some errors.

GVFS URI FORMAT

GVFS uses URI (Uniform Resource Identifier) format to specify file locations. For example, smb://server/share/file.txt or sftp://user@host/path/to/file. It is important to use valid URI formats for gvfs-ls to work properly.

HISTORY

gvfs-ls is part of the GVFS project, which was created to provide a unified virtual filesystem abstraction for GNOME applications. Its development aligns with the evolution of GNOME and its need to seamlessly access diverse storage locations and file systems. Early versions of GVFS aimed to replace the older HAL (Hardware Abstraction Layer) and provide a more flexible and user-space driven solution for file management. gvfs-ls, therefore, emerged as a key command-line utility to interact with GVFS, allowing users and scripts to explore and manage files within the GVFS framework. The command's usage is heavily tied to the adoption of GVFS in GNOME environments for managing network shares, removable media, and cloud storage.

SEE ALSO

gvfs-mount(1), gvfs-open(1), ls(1)

Copied to clipboard