![]() ![]() ![]() $ date -d "23 years ago 2 months 19 days 17 hours 59 minutes" Like the date three Tuesdays from now, five months from now, eight years ago: $ date -d "third tuesday" And that is where we learn about the magic strings that let us ask for dates next week, last year, day of week, and many more. To get the complete story of date you need the GNU coreutils manual. Man date lists a good set of options, but it does not tell you everything. You customize date and time displays to suit your own whims, and in consistent, script-friendly ways. Note how you can use ordinary spacing and punctuation to control the appearance. Man date details all the formatting options. This comes from these FORMAT options for the date command: %r %n%a %b %d, %Y, which you can easily test for yourself: $ date +"%r %n%a %b %d, %Y" For example, the panel clock in Xfce4 supports using the standard date options to customize the date and time display. The date command is fundamental to understanding time options on Linux. It may sound odd, but you must use the date command to see the time on Linux: $ date For example, how long does it take to recursively list all the files in a directory? $ time ls -Rl dir/* To start with, the time command on Linux doesn’t tell the time: $ timeīecause time is a timer for measuring how long a process runs. Telling the time on Linux is more complicated than it might seem at first glance. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |