This repository contains two Bash scripts:
- check_file.sh β Checks if a file exists.
- count_files.sh β Counts how many files are in a specified directory.
Usage:
./check_file.sh filename- Takes a filename (relative or absolute) as an argument.
- Prints whether the file exists or not.
Example:
./check_file.sh myfile.txtUsage:
./count_files.sh /absolute/path/to/directory- Takes an absolute path to a directory.
- Counts and displays how many files (not subdirectories) are inside the directory.
Example:
./count_files.sh /home/naomi/DocumentsBefore using the scripts, make them executable:
chmod +x check_file.sh count_files.sh- Make sure you have Bash installed (common on Linux and macOS, available via Git Bash or WSL on Windows).
- Use absolute paths to avoid unexpected behavior.
This project is open source and free to use under the MIT License.