You can check the file type by using following command from your shell.
root@gunjan#file index.php
It will show following output.
index.php: PHP script text
root@gunjan#file demo_scoredsep.pl
It will show following output.
demo_scoredsep.pl: perl script text
The above commands mostly used while we are not sure about files format.
