那里有很多图形 Google 驱动器客户端。 但是,命令行客户端太少了。 今天,我们将讨论一个名为的命令行 google drive 客户端 无尾礼服. 这个实用程序将对那些主要留在终端的人有所帮助。 Tuxdrive 是一个免费的基于控制台的谷歌驱动客户端,适用于类 Unix 操作系统。 使用 Tuxdrive,我们可以从终端访问 google drive,也可以下载/上传,管理我们在 Google drive 中的所有东西。 它是完全免费和开源的。
Tuxdrive – 适用于 Linux 的命令行 Google Drive 客户端
在 Ubuntu 上安装 Tuxdrive
首先,我们需要安装所需的先决条件 点子3然后安装 google-api-python 客户端 用于向您的 Google 驱动器进行身份验证。
首先,让我们安装 pip3。
在 Ubuntu 和 Linux Mint 等衍生产品上,运行以下命令来安装 pip3。
$ sudo apt-get install python3-pip
安装 pip3 后,使用命令安装 google-api-python-client:
$ sudo pip3 install google-api-python-client
最后,下载最新的 Tuxdrive .deb 包 从这里 并安装它,如下所示。 在编写本指南时,最新版本是 1.0.10.
$ wget https://github.com/prahladyeri/tuxdrive/releases/download/v1.0.10/tuxdrive.deb
$ sudo apt-get install gdebi
$ sudo gdebi tuxdrive.deb
配置
安装后,通过运行以下命令打开 Tuxdrive:
$ tuxdrive
如果您的浏览器在另一台机器上,则退出并使用命令行参数 –noauth_local_webserver 重新运行此应用程序。
$ tuxdrive --noauth_local_webserver
当您第一次运行 tuxdrive 时,它会打开浏览器窗口并请求您代表您访问您的 google drive 的权限。 点击 允许.
谷歌驱动器身份验证
复制验证码:
谷歌驱动器身份验证
并且,将其粘贴到您的终端并按 ENTER。
身份验证过程成功后,您将进入 tuxdirve 提示符。
现在,您可以从终端使用 Tuxdrive 客户端开始访问您的 Google Drive。
用法
要列出 google 驱动器中的所有文件和目录,请运行:
$ ls
或者,
$ dir
样本输出:
tux_drive> ls Credentials fetched successfully. DIRECTORY Technology DIRECTORY Books DIRECTORY Information Security 2 DIRECTORY OSTechNix DIRECTORY Linux DIRECTORY Ultimate IQ Tests - Philip Carter & Ken Russell DIRECTORY Malware DIRECTORY Kodaikanal Trip DIRECTORY Office DIRECTORY ESSN Training Session DIRECTORY .. FILE tuxlogo FILE END FILE END.docx FILE END.docx FILE Technical notes FILE Create USB bootable disk FILE Install Kali Linux Tools FILE How can one become part of the 1%? FILE Cloud Authentication1.docx FILE Cloud Authentication1.docx 20 items found.
要列出谷歌驱动器当前本地工作目录中的所有文件和文件夹,请运行 !目录 或者 !ls.
tux_drive> !dir FILE .bash_logout FILE .wget-hsts DIRECTORY Public DIRECTORY .shutter DIRECTORY .config DIRECTORY .local DIRECTORY .gconf DIRECTORY .gnome2 FILE .bashrc FILE .sudo_as_admin_successful FILE 208_374679378.pdf DIRECTORY Downloads FILE .profile DIRECTORY Videos DIRECTORY Documents DIRECTORY .mozilla DIRECTORY .thumbnails FILE .xsession-errors.old FILE .Xauthority DIRECTORY .cache DIRECTORY .gnupg DIRECTORY Pictures FILE .dmrc FILE examples.desktop FILE .ICEauthority FILE tuxdrive.deb FILE .xsession-errors DIRECTORY Music FILE .bash_history DIRECTORY Desktop DIRECTORY .dbus DIRECTORY Templates DIRECTORY .gnome2_private 33 items found. Local Working Directory is /home/ostechnix tux_drive>
要更改当前的本地工作目录:
tux_drive> lcd Downloads/ Directory changed to Downloads/
要打印驱动器中的当前工作目录,请运行:
tux_drive> pwd Remote Working Directory is /(root) tux_drive>
同样,要打印本地工作目录,请使用“lpwd”命令:。
tux_drive> lpwd Local Working Directory is /home/ostechnix/Downloads
要从 Google 驱动器下载文件,请使用如下所示的“拉取”命令。
tux_drive> pull 208_374679378.pdf File found: /208_374679378.pdf Credentials fetched successfully. Downloading: 0B88FP2CC57vMc2sxR01aVGEwUDZtX0xpMW9nazBLM0VDdS0w(208_374679378.pdf) Downloaded successfully to /home/ostechnix/208_374679378.pdf
所有文件都将下载到当前工作目录,即 $HOME 目录中。
要将文件上传到谷歌驱动器,请使用如下所示的“推送”命令。
tux_drive> push tuxdrive.deb Uploading tuxdrive.deb Credentials fetched successfully. Upload successful Credentials fetched successfully. tux_drive>
要在驱动器中创建新目录,请在 tuxdrive 控制台中运行以下命令。
tux_drive> mkdir senthilkumar Uploading senthilkumar Credentials fetched successfully. Upload successful Credentials fetched successfully. tux_drive>
上述命令将在 Google 驱动器中创建一个名为“senthilkumar”的目录。
要切换到新创建的目录,请运行:
tux_drive> cd senthilkumar Credentials fetched successfully. Remote directory changed to /senthilkumar (0B88FP2CC57vMbWp6YXlCNnQ3aWM) tux_drive>
要检查我们现在的位置,请使用“pwd”命令:
tux_drive> pwd Remote Working Directory is /senthilkumar(0B88FP2CC57vMbWp6YXlCNnQ3aWM)
要返回谷歌驱动器中的根目录,请运行:
tux_drive> cd / Credentials fetched successfully. Remote directory changed to / (root)
要删除驱动器中的文件或目录,请运行:
tux_drive> rm senthilkumar senthilkumar is a directory. Are you sure you want to delete it? (Y/n)y Credentials fetched successfully. Item 0B88FP2CC57vMbWp6YXlCNnQ3aWM deleted.
要查看帮助部分,请运行“帮助”。
tux_drive> help Commands: help (or ?): Shows this help facility. dir (or ls): Lists all files and folders on drive. !dir (or !ls): Lists all files and folders in current directory. pull <item>: Pulls the named file/folder from drive to current working directory. push <item>: Pushes the named file/folder from current working directory to drive. rm <item>: Delete the named file/folder on remote path. pwd: Print working directory (remote/drive) cd: Change working directory (remote/drive) lpwd: Print working directory (local) lcd: Change working directory (local) rdcache: Show remote directory mapping of id and folder paths. rfcache: Show remote files mapping of id and folder paths. mkdir: Create a directory on remote path. exit: Exits this program. tux_drive>
由于 Tuxdrive 是非常新的并且正在积极开发中,因此会有错误。 如果您发现任何错误,请在下面给出的 GitHub 页面中通知开发人员。
干杯!
资源:
感谢您的光临!
帮助我们帮助您:
- 订阅我们的电子邮件通讯: 立即注册
- 支持 OSTechNix: 通过贝宝捐款
- 下载免费的电子书和视频: TradePub 上的 OSTechNix
- 联系我们: Facebook | Twitter | 谷歌加 | 领英 | RSS订阅
祝你有美好的一天!!