Home / Programming / Bash

Bash

Estimate how long shred or rm will take on millions of files

Today I came across a challenge, try and figure out how long it will take to remove millions of files from our systems. We are all about security, so we need to run shred rather than rm when we remove ...

Read More »

Customize Your Bash Prompt

Bash Prompt The bash prompt, when customized, can be more useful than most people think. The default one that comes with most distros is pretty ugly and boring. The default is… Which looks like this when you’re in the console: ...

Read More »

Bash Tips And Tricks (Part 1)

I have always thought of bash as a “Quick ‘n Dirty” way of taking care of things, it isn’t by any means a powerful language. It’s not meant for writing programs, not meant for creating games, not meant for much ...

Read More »

Bash Parallel – easily run parallel processes in bash

You don’t have to write complicated bash shell scripts to accomplish parallel processing! Take this as an example of the hard way, It’s going to create 5 “threads” and each while loop can run with 5 at a time. Eh… Complicated. ...

Read More »

Simple Bash Script to Sort File Types into Directories

Often times I find myself needing to sort a lot of files into certain directories, for example I have downloaded a lot of free ebooks and a lot of them have different file types such as epub, mobi, azw, or ...

Read More »

10 Simple BASH Commands to Make Your Life Easier

Knowing how to quickly manipulate the command line in the BASH shell will save you a lot of time and frustration.  Here are 10 Simple key combinations that will make your life easier and speed up your line editing skills. ...

Read More »

Viewing Bash Exit Status Codes With Pipes

Recently I was executing bash scripts from within bash scripts, and executing commands based off of exit code, typically I just use or just the typical But now what if you are also piping the output of script.sh through tee? Then you ...

Read More »

Why the GOTO Statement Is Evil

What is the goto statement? Basically, it’s a way for you to easily “jump” around in your code. You can insert “goto labels” within your code, then simply jump to that segment of your code by just inserting “goto LABELNAME”. ...

Read More »

Bash script to create MySQL database and user

I don’t know about you, but often times I find myself needing to create a MySQL database and I simply forget all of the commands. This is really something that I should remember, but for some strange reason I just ...

Read More »

A better nslookup

If you’re a Systems Administrator, and you use a Mac or any flavor of Linux/Unix for your workstation, chances are you have used the nslookup command, typically located at /usr/bin/nslookup. It’s a fairly simple command, used to resolve a hostname to ...

Read More »