Skip to content

Naomiel/file-check-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

File Check Scripts

This repository contains two Bash scripts:

  1. check_file.sh – Checks if a file exists.
  2. count_files.sh – Counts how many files are in a specified directory.

πŸ“ Script Descriptions

βœ… check_file.sh

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.txt

πŸ“Š count_files.sh

Usage:

./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/Documents

πŸ”§ Make Scripts Executable

Before using the scripts, make them executable:

chmod +x check_file.sh count_files.sh

πŸ“Œ Notes

  • 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.

πŸ“Ž License

This project is open source and free to use under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages