This shell script allows you to search for files within a directory that contain a specific keyword. It provides a convenient way to find files based on their content.
To use the script, follow these steps:
-
Clone the repository or download the
run.sh
file. -
Open a terminal and navigate to the directory where the script is located.
-
Check the permissions of the file:
ls -l run.sh
This command will list the permissions of the file.
- Grant execute permission to the file:
chmod +x run.sh
This command grants execute permission to the run.sh file.
- Verify the permissions of the file again:
ls -l run.sh
You should now see an 'x'
(execution) permission among the file's permissions.
- Run the script with the following command:
./run.sh <keyword> <directory>
Replace <keyword>
with the word you want to search for, and <directory>
with the path to the directory you want to search within.
- The script will iterate through the files in the specified directory and display the names of the files that contain the provided keyword.
To illustrate how the script works, consider the following example:
./run.sh hello /path/to/directory