Linux command
drive 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize drive in directory
drive init [~/gdrive]
Pull files from Google Drive
drive pull [path/to/file]
Push files to Google Drive
drive push [path/to/file]
List files in Google Drive
drive list
Pull all changes
drive pull -all
Push with force
drive push -force [path]
Show differences
drive diff [path]
说明
drive is a command-line client for Google Drive. It provides a git-like interface for synchronizing files between local directories and Google Drive, with explicit push and pull operations rather than automatic sync. The tool requires OAuth authentication on first use. Files are tracked in a local context directory, and operations compare local state with remote to determine what needs synchronization.
参数
- init
- Initialize drive context in directory.
- pull _path_
- Download files from Google Drive.
- push _path_
- Upload files to Google Drive.
- list _path_
- List files and directories.
- diff _path_
- Show differences between local and remote.
- trash _path_
- Move files to trash.
- untrash _path_
- Restore files from trash.
- delete _path_
- Permanently delete files.
- -all
- Apply operation to all files.
- -force
- Force operation without confirmation.
- -no-prompt
- Disable confirmation prompts.
- -depth _n_
- Limit directory traversal depth.
FAQ
What is the drive command used for?
drive is a command-line client for Google Drive. It provides a git-like interface for synchronizing files between local directories and Google Drive, with explicit push and pull operations rather than automatic sync. The tool requires OAuth authentication on first use. Files are tracked in a local context directory, and operations compare local state with remote to determine what needs synchronization.
How do I run a basic drive example?
Run `drive init [~/gdrive]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init do in drive?
Initialize drive context in directory.