LinuxCommandLibrary

gvfs-rename

Rename files or directories using GVFS

SYNOPSIS

gvfs-rename [OPTION...] LOCATION [NEW NAME]

PARAMETERS

--help
    Show help information and exit

--version
    Print version information and exit

DESCRIPTION

gvfs-rename is a command-line tool from the GVFS (GNOME Virtual File System) package, used to rename files or directories across various filesystem backends. GVFS provides userspace access to local files (file://), remote servers (smb://, ftp://, webdav://), and specialized storage like Google Drive or MTP devices, all via URI notation.

This utility offers a simple, transparent way to perform rename operations without mounting filesystems manually. It leverages the GIO library to interact with backends, attempting an atomic rename where supported; otherwise, it may fallback to copy-and-delete. Ideal for scripts, automation, or integration with GNOME apps like Nautilus.

Unlike mv(1), it handles remote URIs natively but is limited to same-directory renames. For cross-directory moves, use gvfs-move. The command requires the source URI and new basename, preserving the parent directory.

CAVEATS

Renames only within the same parent directory; use gvfs-move for relocations.
Not all GVFS backends support atomic rename (e.g., some HTTP-based may fail).
Requires write access; operations on remote locations depend on network/backend availability.

EXAMPLES

Local rename: gvfs-rename file:///tmp/old.txt new.txt

SMB share: gvfs-rename smb://server/share/foo.doc bar.doc

FTP: gvfs-rename ftp://host/dir/file newfile

EXIT STATUS

0 for success, non-zero for errors (e.g., permission denied, invalid URI).

HISTORY

Introduced in GVFS 1.2 (2008) with GNOME 2.24, replacing GnomeVFS for modular, extensible virtual filesystem support. Evolved alongside GIO for better desktop integration.

SEE ALSO

mv(1), gio(1), gvfs-move(1), gvfs-copy(1)

Copied to clipboard