Tag Archives: Bash

Useful Bash functions to determine OS and more

In a number of my Bash aliases I need to check two constants: what sort of OS I’m on and whether it’s a production box or not. I use the former for aliases that allow me to install and search … Continue reading

Posted in CLI, Programming | Tagged , | 1 Comment

Useful ways to list directory contents

The ls command becomes second nature once you work in a Linux command line environment for any appreciable period of time. Commonly, it seems, people simply stick with the plain vanilla command, without exploring its rich options, as well as … Continue reading

Posted in CLI | Tagged , , | 3 Comments

Easily sum matching file line counts

This command will return the number of total lines contained in files ending in .py in the directory it is run in, as well as subdirectories: 12find . -type f -iname *py | xargs -I str wc -l str | … Continue reading

Posted in CLI | Tagged , | Leave a comment

vim for Bash scripting: A happier union

Two factors recently caused me to look less than positively toward writing Bash scripts. First, I have started actively using Python more, and performing tasks in it that I would have previously written in Bash. Second, I came across a … Continue reading

Posted in CLI, Programming | Tagged , , , , | 1 Comment

Improving command line efficiency via Bash history

If you work in Bash with any frequency, hopefully you collect aliases to make your life easier. Complicated and highly useful commands should be saved and re-used so that you can get to the information you need in the least … Continue reading

Posted in CLI, Programming | Tagged , , , | 6 Comments