Is there any command to display the recently modified/created files?
Which one...?
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
find ${1} -type f | xargs stat --format '%Y :%y %n' 2>/dev/null | sort -nr | cut -d: -f2-
See Find command
-iname
. For example, find *.txt file but ignore hidden .txt file such as .vimrc you would -type f \( -iname "*.txt" ! -iname ".*" \)
.
Check stat
command:
Usage:
stat [options] filename ... ...
e.g.
stat /home/user/Docs/filename.txt
To search for files, use find
commands:
e.g.
find /to/target/directory* -mtime -1
(the switch -mtime n
show file's with data last modified n*24 hours ago, for -mtime -1
the files 1 day old will be shown)
find /to/target/directory* -mmin 30
will show files modified in last 30 minutes.
Check for more options under TESTS in the manual pages (use man find
in terminal). You can use other switches like -amin n
(last accessed n minutes ago), -cmin
(file's status was last changed n minutes ago), and others.
stat filename
where filename could be your target's absolute or relative path. This will show access, modification, change times among other outputs..
stat
will also give you the file's birth time if the filesystem supports that..
stat
gives out properties of a specific file or directory(like when it was modified last time). Therefore this command is not appropriate for this question.
Jan 27, 2014 at 12:02