# a script to get date/time of file modification



## t4z3v4r3d (Mar 9, 2010)

I want to check my files (recursive), and time of modifying .
anybody has better method ?

```
#!/usr/local/bin/bash
### for checking path edit it !
path=$1
find $path |  sed "s/^.*/&/" | while read -ers correct_file_name;do
if [ -f "$correct_file_name" ];then
 echo -en  "$correct_file_name 		$(perl -e 'print ((stat($ARGV[0]))[9],"\n");' "$correct_file_name" )\n"
 elif [ -d "$correct_file_name" ];then
 echo -e "\033[1;31m Directory "$correct_file_name" \033[0;0m"
else
 echo -e "\033[1;31m Cant find "$correct_file_name" \033[0;0m"
#    exit
fi
done
```


----------



## jalla (Mar 9, 2010)

```
ls -rlF|tr -s ' '|cut -d ' ' -f 6-
```

?


----------



## SirDice (Mar 9, 2010)

[cmd=]find . -type f -exec stat -f "%Sm %N" {} \;[/cmd]

Or easily sortable:
[cmd=]find . -type f -exec stat -f "%Sm %N" -t %Y%m%d%H%M%S {} \;[/cmd]


----------

