? Back to Blog

Guide to uploading files directly from command line

Brendan G · 2026-04-19

Guide to Uploading Files Directly from the Command Line with FileShot.io

Introduction

As a developer or system administrator, you likely spend a significant amount of time managing files and folders. Manual file uploads can be time-consuming and prone to errors. FileShot.io's command line interface offers a convenient solution, enabling you to upload files directly from your terminal. In this comprehensive guide, we'll walk you through the process of using FileShot.io's command line interface to upload files efficiently.

Prerequisites

Before you begin, ensure you have the following: * A FileShot.io account * Access to a terminal or command prompt * The FileShot.io command line interface installed on your system

Installing the FileShot.io Command Line Interface

To use FileShot.io's command line interface, you'll need to install the FileShot.io CLI package on your system. The installation process varies depending on your operating system. Follow these steps for your respective OS: * Windows: + Open a command prompt as an administrator. + Run the following command: `pip install filesot` + Verify the installation by running: `filesot --version` * macOS (using Homebrew): + Run the following command: `brew install filesot` + Verify the installation by running: `filesot --version` * Linux (using pip): + Run the following command: `pip install filesot` + Verify the installation by running: `filesot --version` * Linux (using apt-get): + Run the following command: `sudo apt-get install python3-pip` + Run the following command: `pip3 install filesot` + Verify the installation by running: `filesot --version`

Configuring the FileShot.io CLI

After installing the FileShot.io CLI, you may need to configure it to work with your FileShot.io account. You can do this by running the following command: `filesot config --token=` Replace `` with your actual FileShot.io API token.

Uploading Files from the Command Line

With the FileShot.io CLI installed and configured, you're ready to upload files from the command line. Here are the basic upload commands: * Upload a single file: `filesot upload ` * Upload multiple files: `filesot upload ... ` * Upload a directory: `filesot upload ` Replace `` or `` with the actual path to the file or directory you want to upload.

Options and Flags

The FileShot.io CLI provides various options and flags to customize your upload process. Here are some common ones: * --token: Specify your FileShot.io API token to authenticate the upload. * --folder: Upload files to a specific folder on FileShot.io. * --overwrite: Overwrite existing files on FileShot.io. * --dry-run: Perform a dry run, simulating the upload without actually uploading files. * --rename: Rename the file on FileShot.io to a specified name. * --description: Add a description to the uploaded file. For example: * `filesot upload --token= --folder=/path/to/folder --overwrite ` * `filesot upload --token= --folder=/path/to/folder --rename=new_name ` * `filesot upload --token= --folder=/path/to/folder --description="This is a description" `

Uploading Large Files

FileShot.io's command line interface allows you to upload large files in chunks, making it easier to manage and upload large files. To upload a large file in chunks, use the following command: `filesot upload --chunk-size=` Replace `` with the desired chunk size (in bytes). For example: * `filesot upload large_file.txt --chunk-size=1000000`

Automating File Uploads

FileShot.io's command line interface allows you to automate file uploads using scripts or cron jobs. This feature is particularly useful for scheduling regular backups or uploading files after a specific event. To automate file uploads, create a script that runs the `filesot upload` command with the desired options and flags. Then, schedule the script to run at regular intervals using cron or your preferred scheduler. For example: * Create a script called `upload_files.sh` that runs the following command: `filesot upload --token= --folder=/path/to/folder ` * Schedule the script to run every hour using cron: `0 * * * * /path/to/upload_files.sh`

Troubleshooting

If you encounter any issues while using the FileShot.io CLI, you can troubleshoot the problem by checking the following: * Make sure you have the correct API token and folder path. * Check the file path and existence of the file. * Verify that the file is not too large to upload. * Check the console output for any error messages.

Conclusion

Uploading files directly from the command line with FileShot.io's CLI simplifies your workflow, saving you time and reducing errors. By following this guide, you've learned how to install the FileShot.io CLI, configure it, upload files, and leverage options and flags to customize your upload process. Take advantage of automation features to streamline your file management tasks and make the most out of FileShot.io's command line interface.

Join the affiliate program and earn 50%. No approvals, no waitlists.