Overview
Theadd command adds a directory to know’s watch list. Once added, directories can be indexed using the know index command.
Syntax
Parameters
The path to the directory you want to add to the watch list. Can be absolute or relative.
Behavior
- Resolves the directory path to its absolute form
- Validates that the path exists and is a directory
- Adds the directory to
~/.know_dirsif not already present - Prevents duplicate entries
Examples
Add current directory
Add absolute path
Add already tracked directory
Error: Invalid directory
Directories must exist and be valid before adding. The command will validate the path and exit with an error if invalid.
Next Steps
After adding directories, use:know dirsto view all watched directoriesknow indexto index the added directoriesknow remove <directory>to remove from watch list