From the course: Linux Bash Shells and Scripts: Streamlining Tasks and Enhancing Workflows with Automation

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Date and time commands

Date and time commands

- [Instructor] So let's look at some fundamental commands having to do with time, including the date command that not only tells you the date but tells you the time. And you can find out how long something takes by gettin' the date and time doing it, and gettin' the date and time again. But there's more convenient, more accurate ways of timing how long things take. And also on Linux, you can find out how much time a program has already taken, and you can find out about other resource usages of a program, of a process. The date command has a few options. Basically, it's for printing the current date and time, but you can specify with different sort of syntax what date you want, like it understands the word tomorrow, or you can say -90days from now. Or you could do some fancy arithmetic with some Bash syntax we'll talk about later to calculate how many minutes from now you're interested in. And there's actually an international standard for date formats, you can use the capital I option…

Contents