How to use find command with sorting by creation date&time recursively?How do I parse command line arguments in Bash?Shell command to tar directory excluding certain files/foldersHow to count all the lines of code in a directory recursively?How do I grep recursively?How to exclude a directory in find . commandHow to reload .bash_profile from the command line?How do I set a variable to the output of a command in Bash?How to recursively find and list the latest modified files in a directory with subdirectories and times?How can I recursively find all files in current and subfolders based on wildcard matching?How do I find all files containing specific text on Linux?

When calculating averages, why can we treat exploding die as if they're independent?

Maze generator & animator in Python

Error using exec in find command

Capacitors with same voltage, same capacitance, same temp, different diameter?

What is the difference between tl_to_str:V and tl_to_str:N?

What is the name/purpose of this component?

Is every sentence we write or utter either true or false?

How invisible hand adjusts stock prices if company is listed on multiple exchanges, under multiple currencies, and one of the currencies plunges?

How do I decide when to use MAPE, SMAPE and MASE for time series analysis on stock forecasting

Why can't some airports handle heavy aircraft while others do it easily (same runway length)?

Are programming languages necessary/useful for operations research practitioner?

How to descend a few exposed scrambling moves with minimal equipment?

Who is the uncredited actor leading the squad in the Valerian movie?

How can I protect myself in case of attack in case like this?

Problem with listing a directory to grep

When did computers stop checking memory on boot?

How strong is aircraft-grade spruce?

A PEMDAS issue request for explanation

Gap in tcolorbox after title

I need to know information from an old German birth certificate

More than three domains hosted on the same IP address

How can faith be maintained in a world of living gods?

Why is it that I have to play this note on the piano as A sharp?

How to capture c-lightining logs?



How to use find command with sorting by creation date&time recursively?


How do I parse command line arguments in Bash?Shell command to tar directory excluding certain files/foldersHow to count all the lines of code in a directory recursively?How do I grep recursively?How to exclude a directory in find . commandHow to reload .bash_profile from the command line?How do I set a variable to the output of a command in Bash?How to recursively find and list the latest modified files in a directory with subdirectories and times?How can I recursively find all files in current and subfolders based on wildcard matching?How do I find all files containing specific text on Linux?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I have many time tried for this issue.

find command results do not care listing order.



How to use directory listing based on creation date&time from find recursive command result ?



ls -lc 


This works good , but not recursively way .



find . -type f -iname "*.txt" -exec ls -lc ; 


This doesn’t work.



find . -type f -iname "*.txt" | sort -n 


This also only name based.










share|improve this question


























  • i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

    – cool jobs
    Mar 28 at 8:20


















-1















I have many time tried for this issue.

find command results do not care listing order.



How to use directory listing based on creation date&time from find recursive command result ?



ls -lc 


This works good , but not recursively way .



find . -type f -iname "*.txt" -exec ls -lc ; 


This doesn’t work.



find . -type f -iname "*.txt" | sort -n 


This also only name based.










share|improve this question


























  • i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

    – cool jobs
    Mar 28 at 8:20














-1












-1








-1








I have many time tried for this issue.

find command results do not care listing order.



How to use directory listing based on creation date&time from find recursive command result ?



ls -lc 


This works good , but not recursively way .



find . -type f -iname "*.txt" -exec ls -lc ; 


This doesn’t work.



find . -type f -iname "*.txt" | sort -n 


This also only name based.










share|improve this question
















I have many time tried for this issue.

find command results do not care listing order.



How to use directory listing based on creation date&time from find recursive command result ?



ls -lc 


This works good , but not recursively way .



find . -type f -iname "*.txt" -exec ls -lc ; 


This doesn’t work.



find . -type f -iname "*.txt" | sort -n 


This also only name based.







linux bash shell command






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 8:02









PrakashG

1,5474 gold badges14 silver badges25 bronze badges




1,5474 gold badges14 silver badges25 bronze badges










asked Mar 28 at 7:33









cool jobscool jobs

337 bronze badges




337 bronze badges















  • i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

    – cool jobs
    Mar 28 at 8:20


















  • i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

    – cool jobs
    Mar 28 at 8:20

















i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

– cool jobs
Mar 28 at 8:20






i have found solution like below !! on macos #------------------------------------------------------------------------------------------------------------ find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n #------------------------------------------------------------------------------------------------------------

– cool jobs
Mar 28 at 8:20













1 Answer
1






active

oldest

votes


















2
















solution from https://superuser.com/q/294161/992527 combined with the command from the question:



find . -type f -iname "*.txt" -printf "%T@ %Tc %pn" | sort -n


See the different answers for variations of the command.

Explanation cited from referenced question:




printf arguments from man find:



  • %Tk: File's last modification time in the format specified by k.


  • @: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.


  • c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).


  • %p: File's name.




Solution for MacOS copied from @cooljobs' comment to the question



find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n 





share|improve this answer



























  • won't works on macos terminal .

    – cool jobs
    Mar 28 at 8:02






  • 2





    @cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

    – user1934428
    Mar 28 at 8:05











  • Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

    – cool jobs
    Mar 28 at 8:13










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392271%2fhow-to-use-find-command-with-sorting-by-creation-datetime-recursively%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2
















solution from https://superuser.com/q/294161/992527 combined with the command from the question:



find . -type f -iname "*.txt" -printf "%T@ %Tc %pn" | sort -n


See the different answers for variations of the command.

Explanation cited from referenced question:




printf arguments from man find:



  • %Tk: File's last modification time in the format specified by k.


  • @: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.


  • c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).


  • %p: File's name.




Solution for MacOS copied from @cooljobs' comment to the question



find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n 





share|improve this answer



























  • won't works on macos terminal .

    – cool jobs
    Mar 28 at 8:02






  • 2





    @cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

    – user1934428
    Mar 28 at 8:05











  • Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

    – cool jobs
    Mar 28 at 8:13















2
















solution from https://superuser.com/q/294161/992527 combined with the command from the question:



find . -type f -iname "*.txt" -printf "%T@ %Tc %pn" | sort -n


See the different answers for variations of the command.

Explanation cited from referenced question:




printf arguments from man find:



  • %Tk: File's last modification time in the format specified by k.


  • @: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.


  • c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).


  • %p: File's name.




Solution for MacOS copied from @cooljobs' comment to the question



find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n 





share|improve this answer



























  • won't works on macos terminal .

    – cool jobs
    Mar 28 at 8:02






  • 2





    @cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

    – user1934428
    Mar 28 at 8:05











  • Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

    – cool jobs
    Mar 28 at 8:13













2














2










2









solution from https://superuser.com/q/294161/992527 combined with the command from the question:



find . -type f -iname "*.txt" -printf "%T@ %Tc %pn" | sort -n


See the different answers for variations of the command.

Explanation cited from referenced question:




printf arguments from man find:



  • %Tk: File's last modification time in the format specified by k.


  • @: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.


  • c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).


  • %p: File's name.




Solution for MacOS copied from @cooljobs' comment to the question



find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n 





share|improve this answer















solution from https://superuser.com/q/294161/992527 combined with the command from the question:



find . -type f -iname "*.txt" -printf "%T@ %Tc %pn" | sort -n


See the different answers for variations of the command.

Explanation cited from referenced question:




printf arguments from man find:



  • %Tk: File's last modification time in the format specified by k.


  • @: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.


  • c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).


  • %p: File's name.




Solution for MacOS copied from @cooljobs' comment to the question



find . -type f -iname "*.txt" -exec stat -f '%B %m %N' ; | rev | cut -d '/' -f 1 | rev | sort -n 






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 28 at 9:46

























answered Mar 28 at 7:40









BodoBodo

3,0481 gold badge4 silver badges18 bronze badges




3,0481 gold badge4 silver badges18 bronze badges















  • won't works on macos terminal .

    – cool jobs
    Mar 28 at 8:02






  • 2





    @cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

    – user1934428
    Mar 28 at 8:05











  • Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

    – cool jobs
    Mar 28 at 8:13

















  • won't works on macos terminal .

    – cool jobs
    Mar 28 at 8:02






  • 2





    @cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

    – user1934428
    Mar 28 at 8:05











  • Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

    – cool jobs
    Mar 28 at 8:13
















won't works on macos terminal .

– cool jobs
Mar 28 at 8:02





won't works on macos terminal .

– cool jobs
Mar 28 at 8:02




2




2





@cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

– user1934428
Mar 28 at 8:05





@cooljobs : Doesn't need to. You specified in your Tags that you are searching for a solution for Linux, not MacOS.

– user1934428
Mar 28 at 8:05













Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

– cool jobs
Mar 28 at 8:13





Ohh, that is my mistake , sorry to you ! i forgot to add macos also :-)

– cool jobs
Mar 28 at 8:13








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392271%2fhow-to-use-find-command-with-sorting-by-creation-datetime-recursively%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript