Command

3 Mar 2025

Install *timewarrior-dataframe* using *pipx* for pivot tables of *timewarrior* summaries

Things to know:

  • Timewarrior (timew) is a command line tool for tracking time.
  • Timewarrior-Dataframe is an extension processes timew export output using the Pandas Python module.

Install #

Timewarrior can be installed on recent Ubuntu releases from the apt repositories. It can also be found in a number of other distro’s packaging systems.

1
2
# Ubuntu (and/or Debian?)
sudo apt install timewarrior

pipx can be used to install the timewarrior-dataframe’s twdf command from it’s git repository.

27 Aug 2024

`apropos` is an overlooked Linux command

Search for Linux command that does what you need #

Sometimes the challenge of using the Linux command line is knowing what commands you need to do certain things. The apropos command lets you search the available commands by matching key words.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
❯ apropos csv
# bench_wcsv (3tcl)    - bench::out::csv - Formatting benchmark results as CSV
# csv (3tcl)           - Procedures to handle CSV data.
# csv2rec (1)          - csv to rec converter
# rec2csv (1)          - rec to csv converter


❯ apropos environment 
# 0desktop (1)         - add programs to the desktop environment
# 30-systemd-environment-d-generator (8) - Load variables specified by environment.d
# byobu-janitor (1)    - script for cleaning and upgrading environment after upgrades
# byobu-reconnect-sockets (1) - Sourcable script that updates GPG_AGENT_INFO and DBUS_SESSION_BUS_ADDRESS in the environment
# check-language-support (1) - returns the list of missing packages in order to provide a complete language environment
# clearenv (3)         - clear the environment
# dbus-update-activation-environment (1) - update environment used for D-Bus session services
# Dpkg::Build::Env (3perl) - track build environment
# env (1)              - run a program in a modified environment
# environ (7)          - user environment
# pam_env.conf (5)     - the environment variables config files
# ...

The command checks all of the installed man pages and package descriptions, however there are circumstances where this could leave out some relevant commands.

15 Dec 2022

`diff` Also Compares Directories

Short post so that I can remember this everytime I need to do something similar!

Using diff on more than individual files #

The quick and dirty explaination is that the GNU/Linux diff command has an -r flag to recursively compare two folders. The command help indicates that it is shorthand for the full --recursive flag, which might be easier to remember.

1
2
3
4
5
diff --help

# ...
  -r, --recursive                 recursively compare any subdirectories found
# ...

Example #

In the following example, “Only in” shows that particular files are only found in one of the folders. By default, matching files are not shown. If a file can be found in both folders and the two versions differ, the normal diff output is provided along with the modified times. All together these details provide a good summary of what a user might want to know when comparing two directories.

19 Aug 2021

Useful Docker Patterns (On GNU/Linux)

To easily copy files from a Docker image when you dont want to start a container, you can do the following:

1
docker cp $(docker create --rm $IMAGE):$FROM_PATH $TO_PATH

Sometimes it is useful to compare the output of a command between two Docker images, especially comparing different versions of a particular image:

1
2
3
docker run --rm -ti --entrypoint=bash $IMAGE1 -c "$CMD" > /tmp/output1.tmp
docker run --rm -ti --entrypoint=bash $IMAGE2 -c "$CMD" > /tmp/output2.tmp
diff -s /tmp/output1.tmp /tmp/output2.tmp

I have both these command patterns saved as executable Bash shell scripts on my system path as cp_docker and diff_docker_cmd respectively.

10 Feb 2021

Overlooked Tools: 'watch'

There many GNU/Linux command line tools that provide continuously updated statistics or information like iotop, nload, and top. However, it is often necessary to see the output of another simple command or complex chain of tools, updated in real-time.

watch is a Linux command that does just that, and by doing so, is incredibly useful for continuously monitoring the output of any Linux terminal command. Usage of the watch command is incredibly simple, as the following example monitoring the currently running tsp task in the task-spooler queue demonstrates.

17 Nov 2020

Overlooked Tools: task-spooler

Sometimes sophisticated job queue and cluster systems are overkill on office or individual PCs, especially for long lists of batch processing jobs that use comparatively few resources.

Use task-spooler to queue commands on Linux and control the number of simultaneous jobs for an easy way to parallelize a list of batch jobs! This tool is a great complement to some other command line workhorses like at and batch.

Task-spooler is not usually installed by default on Linux systems. It can be built by scratch after getting the source from https://vicerveza.homeunix.net/~viric/soft/ts/ or on Ubuntu (maybe other Debian based OS’s) you can use apt: