{"id":13300,"date":"2019-04-01T11:47:02","date_gmt":"2019-04-01T11:47:02","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13300"},"modified":"2019-04-01T11:47:02","modified_gmt":"2019-04-01T11:47:02","slug":"how-to-find-recent-or-todays-modified-files-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-find-recent-or-todays-modified-files-in-linux\/","title":{"rendered":"How to Find Recent or Today\u2019s Modified Files in Linux"},"content":{"rendered":"<p>In this article, we will explain two, simple\u00a0<a href=\"https:\/\/www.tecmint.com\/tag\/linux-tricks\/\" target=\"_blank\" rel=\"noopener\">command line tips<\/a>\u00a0that enable you to only list all today\u2019s files.<\/p>\n<p>One of the common problems Linux users encounter on the command line is\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-find-command-to-search-multiple-filenames-extensions\/\" target=\"_blank\" rel=\"noopener\">locating files with a particular name<\/a>, it can be much easier when you actually know the filename.<\/p>\n<p>However, assuming that you have forgotten the name of a file that you created (in your\u00a0<code>home<\/code>\u00a0folder which contains hundreds of files) at an earlier time during the day and yet you need to use urgently.<\/p>\n<p>Below are different ways of only\u00a0<a href=\"https:\/\/www.tecmint.com\/sort-ls-output-by-last-modified-date-and-time\/\" target=\"_blank\" rel=\"noopener\">listing all files that you created or modified<\/a>\u00a0(directly or indirectly) today.<\/p>\n<p><strong>1.<\/strong>\u00a0Using the\u00a0<a href=\"https:\/\/www.tecmint.com\/tag\/linux-ls-command\/\" target=\"_blank\" rel=\"noopener\">ls command<\/a>, you can only list today\u2019s files in your home folder as follows, where:<\/p>\n<ol>\n<li><code>-a<\/code>\u00a0\u2013 list all files including hidden files<\/li>\n<li><code>-l<\/code>\u00a0\u2013 enables long listing format<\/li>\n<li><code>--time-style=FORMAT<\/code>\u00a0\u2013 shows time in the specified FORMAT<\/li>\n<li><code>+%D<\/code>\u00a0\u2013 show\/use date in %m\/%d\/%y format<\/li>\n<\/ol>\n<pre># ls  -al --time-style=+%D | grep 'date +%D'\r\n<\/pre>\n<div id=\"attachment_23728\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Recent-Files-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23728\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Recent-Files-in-Linux.png\" alt=\"Find Recent Files in Linux\" width=\"722\" height=\"192\" aria-describedby=\"caption-attachment-23728\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23728\" class=\"wp-caption-text\">Find Recent Files in Linux<\/p>\n<\/div>\n<p>In addition, you can\u00a0<a href=\"https:\/\/www.tecmint.com\/sort-command-linux\/\" target=\"_blank\" rel=\"noopener\">sort the resultant list alphabetically<\/a>\u00a0by including the\u00a0<code>-X<\/code>\u00a0flag:<\/p>\n<pre># ls -alX --time-style=+%D | grep 'date +%D'\r\n<\/pre>\n<p>You can also list based on size (largest first) using the\u00a0<code>-S<\/code>\u00a0flag:<\/p>\n<pre># ls -alS --time-style=+%D | grep 'date +%D'\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Again, it is possible to use the\u00a0<a href=\"https:\/\/www.tecmint.com\/35-practical-examples-of-linux-find-command\/\" target=\"_blank\" rel=\"noopener\">find command<\/a>\u00a0which is practically more flexible and offers plenty of options than\u00a0<strong>ls<\/strong>, for the same purpose as below.<\/p>\n<ol>\n<li><code>-maxdepth<\/code>\u00a0level is used to specify the level (in terms of sub-directories) below the starting point (current directory in this case) to which the search operation will be carried out.<\/li>\n<li><code>-newerXY<\/code>, this works if\u00a0<strong>timestamp X<\/strong>\u00a0of the file in question is newer than\u00a0<strong>timestamp Y<\/strong>\u00a0of the file reference. X and Y represent any of the letters below:\n<ol>\n<li>a \u2013 access time of the file reference<\/li>\n<li>B \u2013 birth time of the file reference<\/li>\n<li>c \u2013 inode status change time of reference<\/li>\n<li>m \u2013 modification time of the file reference<\/li>\n<li>t \u2013 reference is interpreted directly as a time<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>This means that, only files modified on\u00a0<strong>2016-12-06<\/strong>\u00a0will be considered:<\/p>\n<pre># find . -maxdepth 1 -newermt \"2016-12-06\"\r\n<\/pre>\n<div id=\"attachment_23729\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Todays-Files-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23729\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Todays-Files-in-Linux.png\" alt=\"Find Today's Files in Linux\" width=\"677\" height=\"192\" aria-describedby=\"caption-attachment-23729\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23729\" class=\"wp-caption-text\">Find Today\u2019s Files in Linux<\/p>\n<\/div>\n<p><strong>Important<\/strong>: Use the correct\u00a0<strong>date format<\/strong>\u00a0as reference in the\u00a0<a href=\"https:\/\/www.tecmint.com\/find-directory-in-linux\/\" target=\"_blank\" rel=\"noopener\">find command<\/a>\u00a0above, once you use a wrong format, you will get an error as the one below:<\/p>\n<pre># find . -maxdepth 1 -newermt \"12-06-2016\"\r\n\r\n<strong>find: I cannot figure out how to interpret '12-06-2016' as a date or time<\/strong>\r\n<\/pre>\n<p>Alternatively, use the correct formats below:<\/p>\n<pre># find . -maxdepth 1 -newermt \"12\/06\/2016\"\r\nOR\r\n# find . -maxdepth 1 -newermt \"12\/06\/16\"\r\n<\/pre>\n<div id=\"attachment_23730\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Todays-Modified-Files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23730\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Todays-Modified-Files.png\" alt=\"Find Todays Modified Files in Linux\" width=\"733\" height=\"420\" aria-describedby=\"caption-attachment-23730\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23730\" class=\"wp-caption-text\">Find Todays Modified Files in Linux<\/p>\n<\/div>\n<p>You can get more usage information for\u00a0<code>ls<\/code>\u00a0and\u00a0<code>find<\/code>\u00a0commands in our following series of articles on same.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/15-basic-ls-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">Master Linux \u2018ls\u2019 Command with This 15 Examples<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/linux-ls-command-tricks\/\" target=\"_blank\" rel=\"noopener\">Useful 7 Quirky \u2018ls\u2019 Tricks for Linux Users<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/35-practical-examples-of-linux-find-command\/\" target=\"_blank\" rel=\"noopener\">Master Linux \u2018find\u2019 Command with This 35 Examples<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/linux-find-command-to-search-multiple-filenames-extensions\/\" target=\"_blank\" rel=\"noopener\">Ways to Find Multiple Filenames with Extensions in Linux<\/a><\/li>\n<\/ol>\n<p>In this article, we explained two important tips of how to list only today\u2019s files with the help of ls and find commands. Make use of the feedback form below to send us any question(s) or comments about the topic. You can as well inform us of any commands used for the same goal.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/find-recent-modified-files-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will explain two, simple\u00a0command line tips\u00a0that enable you to only list all today\u2019s files. One of the common problems Linux users encounter on the command line is\u00a0locating files with a particular name, it can be much easier when you actually know the filename. However, assuming that you have forgotten the name &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-find-recent-or-todays-modified-files-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Find Recent or Today\u2019s Modified Files in Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13300","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13300"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13300\/revisions"}],"predecessor-version":[{"id":13301,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13300\/revisions\/13301"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}