26

I rarely ever use the date command, but when I need it I almost always struggle to get the right incantation. So, wrote a blog post for easy reference.

Do you use a cheatsheet as well?

top 16 comments
sorted by: hot top controversial new old
[-] quantenzitrone@lemmings.world 19 points 2 months ago

the manpage has me covered tbh

[-] Vector@lemmy.world 12 points 2 months ago

I thought that was…

mandated

YyyYyYeeeaaaAaaAaaAhhHhHhhhHH

[-] CubitOom@infosec.pub 10 points 2 months ago

After a man date, I like to do a man touch and man mount.

[-] Deckweiss@lemmy.world 8 points 2 months ago

Try the tldr util on linux.

[-] bobthecowboy@lemmy.world 7 points 2 months ago

I'm addition to tldr which someone else suggested, there's also the cheat command. It's pretty easy to add to it's cheat sheets, if you have custom commands, or want to keep a specific example. I've never kept a physical cheat sheet... They're just too inconvenient and my fingers are probably already at the keyboard.

[-] SweetCitrusBuzz@beehaw.org 2 points 2 months ago

Thanks for posting this. Exmples are very useful.

[-] loaExMachina@sh.itjust.works 2 points 2 months ago

Saving this post in case I ever get a date.

[-] atzanteol@sh.itjust.works 1 points 2 months ago

LLMs do this pretty well. I've used them for date/time formatting strings across a number of languages.

[-] JackbyDev@programming.dev 2 points 2 months ago

They once wrote me a massive script for parsing a history file instead of telling me about history -i

[-] atzanteol@sh.itjust.works 1 points 2 months ago

The other "real person" who replied to me told me that the Linux date command has nothing to do with formatting.

[-] JackbyDev@programming.dev 2 points 2 months ago

Second sentence of the description from the man pages, "Otherwise, depending on the options specified, date will set the date and time or print it in a user-defined way." not sure what they were on about.

[-] atzanteol@sh.itjust.works 3 points 2 months ago

Right - I'm just saying that it's super annoying that people point out times that llms have been wrong as though humans are never wrong, or even aren't wrong frequently.

[-] JackbyDev@programming.dev 1 points 2 months ago

I get that. It's funny I think I've gotten advice in the past to always check the results of search engines because they can be wrong (as in teachers said it to me) or things about Wikipedia being unreliable. But nobody does those things nowadays. Perhaps someday LLMs will be good enough that we don't need to check them either.

[-] nyan@sh.itjust.works 2 points 2 months ago

date is the command for setting the system date and time from the command line. Nothing to do with formatting, beyond the fact that it presumably applies system locale settings when echoing date-time info.

[-] IsoKiero@sopuli.xyz 5 points 2 months ago

$ whatis date

date (1) - print or set the system date and time

[-] atzanteol@sh.itjust.works 4 points 2 months ago* (last edited 2 months ago)
 date +%Y-%m-%d
this post was submitted on 13 Aug 2024
26 points (100.0% liked)

Linux

47993 readers
1027 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS