Standard Linux

stat

Show file info.

file

Show what type of file something is.

watch

Watch a command for changes in the output.

Or watch how much of the filesystem is free.

Timeout

Let a command run for a limited amount of time:

Useful if you want a process to automatically run, but itโ€™s in danger of stopped, and asking you some questions. For example, if you want to โ€˜apt updateโ€™, then that might work, but it might stall until you answer a question. You canโ€™t really answer that question if the thing is running as part of a script, so to avoid having it hang, just cancel it after 10 minutes (or some time longer than an upgrade might take).

NB: When using sudo, the timeout command will apply to sudo itself, so best to run after the sudo, e.g.

This may still lock the database, but at least you wonโ€™t have a bunch of useless scripts building up.

New Utilities

cloc

Count the lines of code in a repository.

This can be useful for an overview of a project. The program is also great at counting actual lines of code, rather than just lines. The following contains 6 lines:

cloc will recognize blank lines are not lines of code, and recognize joined lines of code as separate.

duf

This outputs disk usage with a nice display.

notify-send

Output a message to your desktop.

This will output a notification to finish making tea in 8 minutes. The โ€˜disownโ€™ statement tells the terminal to leave the process running, even without the terminal.

fzy

This gives you the ability to type through a list to select an item.

Try this for a start:

Okay - not terribly impressive so far. But we can do things with the output.

Now we can find anywhere in the home directory and change directory there instantly. Or open any nearby file in vim:

Now you can just type in vf and type the name of a file you want to edit, and fzy will find it for you.

onefetch

Output a summary of a Git.