if [ -f filename ]
then
echo "file exist"
else
echo "Sorry, file does not exist"
fi

if [ -d directory ]
then
echo "directory exist"
else
echo "Sorry, directory does not exist"
fi


Buy me a beer

Related posts:

  1. shell counter script (remember the number next restart) This script counts one by one every time the user...
  2. Creating & using ext3 filesystem images Ext3 is a linux filesystem and used by most of...
  3. Creating a Patch File In Linux Creating a Patch File: diff -Naur olddir newdir > new-patch-file...
  4. Xkdrive(of XOrg) for ARM9(S3C2440A) cross compile howto Xkdrive ==> cross & scratchbox native both…. 0. toolchain path...
  5. Sample Linux Driver (module) I am generally writing linux drivers for embedded systems for...