I am only wanting the file name and the modified date. Is that possible? Not with ls alone. But you just got a nice answer using stat. Add a comment. Active Oldest Votes. Improve this answer. Arronical Arronical Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Please keep in mind that all comments are moderated and your email address will NOT be published.
Save my name, email, and website in this browser for the next time I comment. Notify me of followup comments via e-mail. You can also subscribe without commenting. This site uses Akismet to reduce spam. Learn how your comment data is processed. Linux Basic ls Commands 1. If you liked this article, then do subscribe to email alerts for Linux tutorials.
If you have any questions or doubts? Related Posts. Hopefully, you won't have an issue viewing when files were last modified. I prefer using 'ls' over all the others because ls allows you to control precisely how the date and time are displayed. I believe stat only gives the choice between seconds-since-epoch and human-readable, with no control over the human-readable format. See 'man date' for all the available specifiers. I use this alias for my day-to-day ls needs Use stat command to only check modified date.
Thank you. Post edited. In addition to Jan Marek's answer I've noticed you can get away with just: ls --full or ls --fu which will do the same thing as ls --full-time as he described. Or ls --fu. GNU-style long options can be abbreviated as long as there's no ambiguity --f wouldn't work as there's also a --file-type and --format. Note that a future version may introduce a --full-perms so it's dangerous to rely on that.
Great to know! Its all about typing less. PhilT PhilT 1 1 silver badge 3 3 bronze badges. I like this. A lot less noise in the output and only one letter to remember in the future. This seems to change the behavior of ls to date changed rather than the default date modified. This answer is wrong. Codebling Codebling 4 4 silver badges 12 12 bronze badges.
A shame that busybox removed it in newer versions.
0コメント