date_and_time
Table of Contents
If you want to send us your comments, please do so. Thanks
More on comments
Date and Time
at
atq = at -l | List the at queue |
atrm = at -r | Remove an item from the at queue |
at 22:06 -f /home/user/hello.sh | Run hello.sh in sh at 22:06 |
at | Run 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
Program | How to preserve date and time |
---|---|
cp | Use the -a option or the --preserve=mode,ownership,timestamps option |
Filezilla | Enable “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.
date_and_time.txt · Last modified: 29-01-2024 13:50 by wim