A robust and secure terminal-based file manager written in C, providing essential file and directory management operations with comprehensive error handling and user-friendly interface.
-
Directory Navigation
spwd
: Display current working directoryslist [directory]
: List contents of a directory with detailed information- Shows file type, size, and permissions
- Displays total size and item count
- Supports both files and directories
-
File Operations
screatefile <filename>
: Create a new file with proper permissionssremovefile <filename>
: Safely delete a file with confirmationscopy <source> <destination>
: Copy files with progress indicationsmove <source> <destination>
: Move/rename files with cross-filesystem supportsdisplay <filename>
: Display file contents with large file handling
-
Directory Operations
screatedir <dirname>
: Create a new directory with secure permissionssremovefolder <dirname>
: Safely remove directory and contents with confirmationssearch <directory> <pattern>
: Search for files with detailed results
-
Permission Management
spermission <file/directory> <mode>
: Change permissions with validation- Displays both old and new permissions in human-readable format
- Supports standard Unix permission modes (e.g., 755, 644)
- Path traversal protection
- Buffer overflow prevention
- Input validation and sanitization
- Safe memory management
- Proper error handling and reporting
- Secure file operations with confirmations
- Permission validation
- Colorful and intuitive interface
- Progress indicators for long operations
- Detailed error messages and confirmations
- Operation logging for auditing
- Large file handling with warnings
- Cross-platform compatibility (Unix/Linux/macOS)
- GCC compiler
- Make build system
- Unix-like operating system (Linux/macOS)
- Minimum 1GB free disk space recommended
- Clone the repository:
git clone https://github.com/FatihArslan-cmd/C-Terminal-Based-File-Manager.git
cd C-Terminal-Based-File-Manager
- Create the bin directory:
mkdir -p bin
- Build the project:
make
- Run the file manager:
./bin/file_manager
.
├── include/ # Header files
│ ├── file_manager.h # Main header file
│ └── file_manager_logo.h # Logo and UI declarations
├── src/ # Source files
│ ├── main.c # Main program entry
│ ├── file_operations.c # File manipulation functions
│ ├── directory_ops.c # Directory manipulation functions
│ ├── permissions.c # Permission management
│ └── logger.c # Logging functionality
├── utils/ # Utility functions
│ └── logo.c # ASCII art logo and menu
├── Makefile # Build configuration
└── README.md # Project documentation
- List directory contents with details:
> slist .
Contents of directory: .
---------------------------------------------------------------
Name Type Size Permissions
---------------------------------------------------------------
documents Directory 4096 rwxr-xr-x
example.txt File 1024 rw-r--r--
---------------------------------------------------------------
Total: 2 items, 5120 bytes (0.01 MB)
- Copy a file with progress:
> scopy source.txt destination.txt
File 'destination.txt' already exists. Overwrite? (y/n): y
Copying: 75.5% complete
File copied successfully.
- Change file permissions with details:
> spermission myfile.txt 644
Permissions changed for 'myfile.txt':
Old permissions: rwxr-xr-x (755)
New permissions: rw-r--r-- (644)
- Search for files with detailed information:
> ssearch /path/to/dir searchterm
Searching for 'searchterm' in directory: /path/to/dir
---------------------------------------------------------------
Found: example.txt
Type: File
Size: 1024 bytes
Permissions: rw-r--r--
---------------------------------------------------------------
-
Input Validation
- Path traversal prevention
- Buffer overflow protection
- Permission mode validation
- File size checks
-
Operation Safety
- Confirmation for destructive operations
- Progress indication for long operations
- Existing file checks
- Cross-filesystem operation handling
-
Error Handling
- Detailed error messages
- Operation logging
- Memory management
- Resource cleanup
All operations are automatically logged to app_log.txt
with:
- Timestamp
- Operation type
- Details
- Success/Failure status
- Error messages when applicable
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow the existing code style
- Add appropriate error handling
- Include input validation
- Update documentation
- Add tests if applicable
This project is open source and available under the MIT License.
- Thanks to all contributors who have helped with bug fixes and improvements
- Special thanks to the C programming community for their valuable resources
Project Link: https://github.com/FatihArslan-cmd/C-Terminal-Based-File-Manager