
Basic File Operations
Learn how to perform essential file operations with shellA
In This Tutorial
Related Tutorials
Introduction
In this tutorial, you'll learn how to perform basic file operations using shellA's natural language interface. These fundamental operations include copying, moving, renaming, and deleting files, as well as creating new files and folders.
Unlike traditional file managers or command-line interfaces, shellA allows you to perform these operations using simple, natural language commands. This makes file transformation more intuitive and accessible, even for complex tasks.
What You'll Learn
- How to navigate your file system using natural language
- Basic file operations: copy, move, rename, and delete
- Generating new files and folders
- Best practices for file transformation with shellA
Prerequisites
- shellA installed on your computer
- Basic understanding of file systems (folders, files, etc.)
Copying Files
Copying files is one of the most common file operations. With shellA, you can copy files using simple, intuitive commands.
Basic Copy Commands
"Copy all PDFs to a folder called Documents"
This command copies all PDFs from the selected directory to a folder called Documents.
"Copy all PDF files with a filename containing March to a folder called March Invoies"
This command copies all PDF files containing March in the filename from the selected directory to a folder called March Invoices.
Example: Copying Project Files
Let's say you want to copy all the JavaScript files from your current project to a backup folder.
- First, make sure you're in the project directory
- Then say:
"Copy all JavaScript files to the Backup folder"
- shellA will show you a preview of the files that will be copied
- Confirm the operation by saying:
"Yes"
.
Moving Files
Moving files works similarly to copying, but instead of creating a duplicate, the original file is relocated.
Basic Move Commands
"Move all pdfs to a folder called Documents."
This command moves all pdfs from the current directory into a folder called Documents.
"Move all image files to a folder called Photos."
This command moves all image files (like .jpg, .png, etc.) from the current directory to a folder named Photos.
Example: Organizing Files by Type
Let's say you have a folder with mixed file types and want to organize them by type.
- First, create folders for each file type:
"Create folders named Documents, Images, and Videos"
- Move document files:
"Move all PDF, DOCX, and TXT files to the Documents folder"
- Move image files:
"Move all JPG, PNG, and GIF files to the Images folder"
- Move video files:
"Move all MP4 and MOV files to the Videos folder"
Renaming Files
Renaming files is straightforward with shellA. You can rename individual files or batch rename multiple files with patterns.
Basic Rename Commands
"Rename any pdf containing report in the final name to annual_report_ and the created date of the file."
This command renames all pdfs containing report to annual_report + [created_date_of_file]".
"Rename all image files to include today's date"
This command adds today's date to the filename of all image files in the current directory.
Example: Standardizing Filenames
Let's say you have a set of files with inconsistent naming and want to standardize them.
- For a single file:
"Rename 'messy file name.docx' to 'project_report.docx'"
- For multiple files:
"Rename all files to follow the pattern 'project_file_001.ext'"
shellA will intelligently maintain the original file extensions while applying your naming pattern.
Deleting Files
Deleting files is a sensitive operation, so shellA always asks for confirmation before permanently removing files.
Basic Delete Commands
"Delete old_report.pdf"
This command deletes the specified file after confirmation.
"Move all temporary files to the trash"
This command moves files to the system trash rather than permanently deleting them.
Warning
Be careful when using delete commands. shellA will show you a preview of which files will be deleted and ask for confirmation, but it's always good practice to double-check before confirming.
Creating Files & Folders
shellA makes it easy to create new files and folders with natural language commands.
Creating Folders
"Create a new folder called Projects"
This command creates a new folder named "Projects" in the current directory.
"Create nested folders for my project: src/components, src/utils, and docs"
This command creates a folder structure with multiple nested directories.
Creating Files
"Create a new text file called notes.txt"
This command creates a new empty text file.
"Create a new text file called todo.txt with the content 'Remember to finish the report'"
This command creates a new text file with the specified content.
Example: Setting Up a Project Structure
Let's say you want to set up a basic structure for a new web project.
- Create the main project folder:
"Create a new folder called WebProject"
- Navigate to it:
"Open the WebProject folder"
- Create the folder structure:
"Create folders named src, public, and docs"
- Create subfolders:
"Create folders named components, styles, and utils inside the src folder"
- Create initial files:
"Create a file called index.html in the public folder"
- Add a README:
"Create a file called README.md with a basic project description"
Practice Exercises
Now that you've learned the basic file operations, try these exercises to practice your skills with shellA.
Create a folder structure for organizing your documents, then move files into the appropriate folders.
- Create folders named "Documents", "Images", and "Videos"
- Move all PDF and DOCX files to the Documents folder
- Move all JPG and PNG files to the Images folder
- Move all MP4 files to the Videos folder
Practice batch renaming files with a consistent naming pattern.
- Create several text files with random names
- Rename all text files to follow the pattern "note_X.txt" where X is a sequential number
- Add today's date to the beginning of each filename
Set up a complete project structure with folders and initial files.
- Create a main project folder with your chosen name
- Create appropriate subfolders based on the type of project
- Create initial configuration files and documentation
- Create placeholder files in the appropriate locations
Summary
In this tutorial, you've learned how to perform basic file operations using shellA's natural language interface:
- Navigating your file system
- Copying and moving files
- Renaming files individually and in batches
- Deleting files safely
- Creating new files and folders
These fundamental operations form the building blocks for more advanced file transformation tasks. As you become more comfortable with shellA, you'll find that you can combine these operations in powerful ways to automate complex file transformation tasks.