Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions FileExists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

This script is really helpful to check if a particular file exists or not in a particular folder and at the same time it is very simple to use, one with less or no experience on CLI can also execute the script

Just Follow the steps

-Download the script in the pc where we need to check the presence of the file
-Open terminal or Command Prompt
-Type "chmod +x script4.sh" to give it executable permission
-now to go the folder where you need to check the file
-write the command "bash script4.sh <filename>
-IMP don't forget to write the complete name of the file, for instance "bash script4.sh book.txt"


How this help and makes your life easier.

Incase of any query feel free to connect.

Thank You
Varun Bansal

7 changes: 7 additions & 0 deletions FileExists/script4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
filename=$1
if [ -f "$filename" ]; then
echo "File exists"
else
echo "File does not exist"
fi