Overlooked

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.

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:

16 Nov 2020

Overlooked Tools: xclip

If you have ever had a need to move the output of a Linux console command to your clipboard, xclip is the solution!

To copy a file’s contents to the standard “ctl+c/v” clipboard buffer issue you can following this command:

1
xclip -sel clip your-file-path

The most useful feature is reading from a stdin pipe:

1
head my-file-path | xclip -sel clip

…and then your ready to paste into an email or Slack chat.

1 Jan 0001

Overlooked Tools: 'at'

If you find you are using commands like sleep to run a one-off task at a specific time, then meet the GNU at command.

at will allow you to specify a time to run a specific command, and accepts a wide range of different formats including “now + 4 hours”, “noon”, and “next tuesday”. The command will read commands from stdin or using the -f to specifiy a file to be executed using the default /bin/sh.