It works on Ubuntu systems which has nautilus
as a default file-manager.
Run the below command on terminal to see the recently accessed(aka viewed) files.
sed -nr 's/.*href="([^"]*)".*/\1/p' ~/.local/share/recently-used.xbel
Information about all the recently accessed files are stored in this particular ~/.local/share/recently-used.xbel
file. Extracting only the file along with it's path was done by the above command.
Command Explanation:
sed -nr 's/.*href="([^"]*)".*/\1/p' ~/.local/share/recently-used.xbel
-n
--> suppress automatic printing of pattern space
-r
--> Extended regex. If we use sed with -r
, then we don't have to escape some characters like ((
,)
,{
,}
,etc)
's/.*href="([^"]*)".*/\1/p'
--> sed searches for a line which has this(.*href="([^"]*)".*
) regex in the input file. If it find any, then it grabs only the characters that are within double quotes which was after href=
(href=""
) and stored it in a group. Only the stored group are printed through back-reference(\1
).
Example:
$ sed -nr 's/.*href="([^"]*)".*/\1/p' ~/.local/share/recently-used.xbel
file:///media/truecrypt8/bar.txt
file:///media/truecrypt8/picture.txt
file:///media/truecrypt8/bob.txt
file:///media/truecrypt8/movie.txt
file:///media/truecrypt8/music.txt
file:///media/truecrypt8/foo.txt
If you want the output to be formatted then run this,
$ sed -nr 's/.*href="([^"]*)".*/\1/p' ~/.local/share/recently-used.xbel | sed 's|\/\/| |g'
file: /media/truecrypt8/bar.txt
file: /media/truecrypt8/picture.txt
file: /media/truecrypt8/bob.txt
file: /media/truecrypt8/movie.txt
file: /media/truecrypt8/music.txt
file: /media/truecrypt8/foo.txt
To show all files created on 16/05/2015
:
sudo find / -type f -newermt 2015-05-16
Now to see attributes such as owner, modification date, permissions easily use ls -l
command:
sudo find / -type f -newermt 2015-05-16 | xargs ls -l
Thanks to muru note: same result can be achieved with:
sudo find / -type f -newermt 2015-05-16 -ls
Read this for more information on what ls -l
means.
UPDATE
To sort easily use -t
option with ls (from newest to oldest)
sudo find / -type f -newermt 2015-05-16 | xargs ls -lt
If you want a reverse sort (from oldest to newest)
sudo find / -type f -newermt 2015-05-16 | xargs ls -ltr
And you can pipe it to tee
to output in Terminal and in a log file too.
Best Answer
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
See Find command
Source:Linux