User Tools

Site Tools


date_and_time

If you want to send us your comments, please do so. Thanks
More on comments


Date and Time

ISO 8601 data and time format
About the date command: See date

at

atq = at -lList the at queue
atrm = at -rRemove an item from the at queue
at 22:06 -f /home/user/hello.shRun hello.sh in sh at 22:06
atRun a command at a specific time. Running at 9:00 opens a prompt. Now you can enter a command. Finish with CTRL-d. Example
at 22:10
warning: commands will be executed using /bin/sh
at> echo "Hello from at 22:10"
at> <EOT>
job 12 at Mon Jun 14 22:10:00 2021

Preserve date and time

ProgramHow to preserve date and time
cpUse the -a option or the --preserve=mode,ownership,timestamps option
FilezillaEnable “Preserve timestamps of transferred files” in the Transfer menu. For uploads aditional: works only if the FTP server supports the MFMT (Modify File Modification Time) command

npt

Execution time

To measure the execution time of a program add time in front of the command
Example, ls on an empty directory:

$ time ls

real    0m0,002s
user    0m0,002s  
sys     0m0,000s               

Stopwatch

Very simple

SECONDS=0

Wait a while

echo Elapsed time in seconds: $SECONDS

Result (example)

Elapsed time in seconds: 274

Simple

Just counting

startdate=`date +%s`; while true; do echo -ne "$(date -u --date @$((`date +%s` - $startdate)) +%H:%M:%S)\r"; done

Source: Is there a way to display a countdown or stopwatch timer in a terminal?
There you can find some more nice stopwatch and countdown ideas

With split and lap

Use the command line Stopwatch script from plxelbear


Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
date_and_time.txt · Last modified: 29-01-2024 13:50 by wim