Simply, checking in commandline, using the ls command


Code:
dev@ubuntu:/tmp$ ls -ltr myfile
ls: cannot access 'myfile': No such file or directory

Check using the test command


Code:
test -f myfile
This approach is more useful when you want to check in a script (bash or shell)

What is the result?
Code:
dev@ubuntu:/tmp$ test -f myfile
dev@ubuntu:/tmp$
dev@ubuntu:/tmp$ echo $?
1

This file does not exist so will cause an exit status of 1

Now, let us create a file and test again


Code:
dev@ubuntu:/tmp$ touch myfile
dev@ubuntu:/tmp$ ls -l myfile
-rw-rw-r-- 1 dev dev 0 Aug 25 20:38 myfile
dev@ubuntu:/tmp$
dev@ubuntu:/tmp$ test -f myfile
dev@ubuntu:/tmp$
dev@ubuntu:/tmp$ echo $?
0
dev@ubuntu:/tmp$