time a command
How long a command takes, and how much memory and processor it used.
developmentprocesses
steps
-
time commandreal is the clock time; user and sys, the processor's
-
/usr/bin/time -v commandalso its peak memory (GNU time)
-
hyperfine 'command'run it many times for a fair figure (hyperfine)
notes
- real much bigger than user + sys means it was waiting: the disk, the network or you.
commands used
timehyperfine
Each has a page in lore: lore time opens it.
ask for input in a script
Ask yes or no, read a password without showing it, or wait for an answer with a time limit.
check if a file or folder exists
Test in a script whether a path exists, is a file, a folder, empty or runnable.
check if a string contains a text
Test in a script whether a string contains, starts with or matches something.
count lines of code
How many lines of code a project has, in total and by language.