LinuxCommandLibrary

gvfs-rm

Remove files or directories via GVFS

SYNOPSIS

gvfs-rm [OPTION...] LOCATION...

PARAMETERS

-r, --recursive
    Remove directories and their contents recursively.

-f, --force
    Ignore nonexistent files and arguments, never prompt.

-i, --interactive
    Prompt before every removal.

-I, --once-interactive
    Prompt once before removing more than three files, or when removing recursively. This option overrides -i.

--preserve-root
    Do not operate recursively on '/' (default behavior for safety).

--no-preserve-root
    Operate recursively on '/'.

--help
    Display help information and exit.

--version
    Output version information and exit.

DESCRIPTION

The gvfs-rm command is used to remove files and directories from specified locations accessible via the GNOME Virtual File System (GVFS). GVFS allows applications to access remote and virtual file systems (like SFTP, SMB, MTP, WebDAV, etc.) as if they were local.

Unlike the standard rm command, gvfs-rm operates on GVFS URIs (Uniform Resource Identifiers) which specify the protocol, user, host, and path. For instance, you can delete a file on an SFTP server using a URI like sftp://user@host/path/to/file.txt.

By default, gvfs-rm will not remove a directory unless the -r or --recursive option is explicitly used to indicate recursive deletion.

CAVEATS

gvfs-rm requires explicit use of the -r or --recursive option to remove directories. This is a safety measure to prevent accidental deletion of directory contents.

It operates on GVFS URIs, which require correct syntax for protocol, user, host, and path to ensure the target location is correctly identified. Operating recursively on the root directory (/) is dangerous and prevented by default with --preserve-root.

<B>EXIT STATUS</B>

On success, gvfs-rm returns 0. A non-zero exit code indicates an error during the removal process.

<B>GIO URI FORMAT</B>

gvfs-rm uses GIO URI format for specifying locations. Examples include:
sftp://user@host/path/to/file.txt
smb://server/share/folder/
mtp://[usb:001,003]/Internal shared storage/DCIM/

SEE ALSO

rm(1), gvfs(7), gvfs-cat(1), gvfs-copy(1), gvfs-info(1), gvfs-ls(1), gvfs-mkdir(1), gvfs-move(1), gvfs-open(1), gvfs-rename(1), gvfs-trash(1)

Copied to clipboard