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;
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
add a comment |
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
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
add a comment |
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
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
linux bash shell command
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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 fromman find
:
%Tk
: File's last modification time in the format specified byk
.
@
: 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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 fromman find
:
%Tk
: File's last modification time in the format specified byk
.
@
: 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
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
add a comment |
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 fromman find
:
%Tk
: File's last modification time in the format specified byk
.
@
: 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
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
add a comment |
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 fromman find
:
%Tk
: File's last modification time in the format specified byk
.
@
: 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
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 fromman find
:
%Tk
: File's last modification time in the format specified byk
.
@
: 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
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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