そこにグラフィカルなGoogleドライブクライアントがたくさんあります。ただし、コマンドラインクライアントは非常に少数です。今日は、 Tuxdriveと呼ばれるコマンドラインのGoogleドライブクライアントについて説明します。 。このユーティリティは、主にターミナルに滞在する人に役立ちます。 Tuxdriveは、Unixライクなオペレーティングシステム用の無料のコンソールベースのGoogleドライブクライアントです。 Tuxdriveを使用すると、ターミナルからGoogleドライブにアクセスできます。また、Googleドライブ内のすべてのものをダウンロード/アップロード、管理することもできます。完全に無料でオープンソースです。
Tuxdrive-Linux用のコマンドラインGoogleドライブクライアント
UbuntuへのTuxdriveのインストール
まず、必要な前提条件 pip3をインストールする必要があります 、次に google-api-python-clientをインストールします これは、Googleドライブでの認証に使用されます。
まず、pip3をインストールしましょう。
UbuntuおよびLinuxMintなどの派生物では、次のコマンドを実行して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ドライブにアクセスするための権限を求められます。 許可をクリックします 。

Googleドライブ認証
確認コードをコピーします:

Googleドライブ認証
そして、それをターミナルに貼り付けて、Enterキーを押します。
認証プロセスが成功すると、tuxdirveプロンプトが表示されます。
これで、ターミナルからTuxdriveクライアントを使用してGoogleドライブへのアクセスを開始できます。
使用法
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.
Googleドライブの現在のローカル作業ディレクトリにあるすべてのファイルとフォルダを一覧表示するには、!dirのいずれかを実行します または!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ドライブからファイルをダウンロードするには、次のような「pull」コマンドを使用します。
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ディレクトリにダウンロードされます。
Googleドライブにファイルをアップロードするには、以下のような「プッシュ」コマンドを使用します。
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)
Googleドライブのルートディレクトリに戻るには、次のコマンドを実行します。
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ページで開発者に通知してください。
乾杯!