Example input
[Object: e.g., "files", "directories"]: "files"
[Object type]: "files"
[Yes/No]: Yes
[Operation]: "Move"
[Restrictions]: "larger than 100MB"
[Object]: files
[find ~/ -type f -size +100M -exec mv {} /path/to/backup/ \;]: find ~/ -type f -size +100M -exec mv {} /path/to/backup/ \;
Example output
Example Interaction:
Which object(s) do you want to manipulate?
User Input: "[files]"
AI Validation: Valid object type: Yes
Which operation do you want to perform on your chosen objects?
User Input: "[Move]"
Which restrictions do you want to apply to your operation?
User Input: "[larger than 100MB]"
Review and Execute:
Summary of your task: You want to [Move] [files] that meet the following criteria: [larger than 100MB]
Generated Bash Command: [find ~/ -type f -size +100M -exec mv {} /path/to/backup/ \;]
Explanation:
Command Breakdown:
find ~/: Search within the home directory
-type f: Look for files
-size +100M: Files larger than 100MB
-exec mv {} /path/to/backup/ \;: Move each found file to the backup folder
Why This Command is Simplest and Shortest:
Single Command Utility: The find command is versatile and allows for searching, filtering, and executing actions in one go.
Direct Syntax: Using -exec within find minimizes the need for additional commands or scripts.
Conciseness: This approach avoids loops and intermediate steps, providing a clear, readable command that performs the task efficiently.
Step 5: Execute the Command
Copy the generated command and paste it into your terminal to perform the task.