Linux Shell Script to Determine whether a file exist or not
Shell script is a series of command’s written in a plain text file. It is somewhat similar to the batch-file in MS-DOS but have much more power and functionality than MS-DOS batch file. The major advantage is that you don’t need to write the same set of instructions again, since you can execute it via your script file. It is majorly used to automate the tasks of day to day life and moreover can be used to automate the system administration part.
Below is an example of a script file by which you can determine whether a file exists or not. This script is used to tell you only whether file exists or not, but not its location as to where it is located. For that you can use FIND OR LOCATE command. We have created a file named existence-of-file.sh you may create a file with some other name. But it is convenient to save the file with ( .sh ) extension so that at later point of time you can recognize that it is a script file. Also in below code whatever is in front of # is a comment.
