Make Your Bash Prompt Work For You

If you work with Linux or Unix-like operating systems like Ubuntu or the MacOS, you might be familiar with Bourne-Again Shell or BASH for short. This article will show you that with a little elbow grease, you can have your BASH prompt work for you and heck maybe have a little fun with it. People tell me the invention of the GUI (graphical user interface) is the best thing that ever happened to modern computing. I beg to differ. Not all work is accomplished through the GUI nor is it efficient.

Continue Reading

Use Export Command To Help Linux Find Your Scripts

Level: Beginner, Intermediate Yeah your a rockstar! You compiled and installed a linux binary or made a nifty script but you don’t want to mess the server bin tree. So you placed it in an isolated folder like so: /usr/local/myscripts/really/great/work/bin/myutility You go on with business as usual. But soon you got tired of typing the whole path or changing folders every time you need the app. You could simplify your life by making a symbolic link(shortcut) or a wrapper script and place it on a more convenient path like /bin or /usr/bin. But you realize that would be defeating your …

Continue Reading

How to Write a Backup Shell Script using Tar and Gnu Zip

Happy New Year! As promised I made a rudimentary Linux shell script utilizing the tar and gzip commands to archive or make backups. If you’re new to shell scripting you might like to read this articles. http://www.dartmouth.edu/~rc/classes/ksh/print_pages.shtmlhttp://tldp.org/LDP/abs/html/ If you’re lazy like I am. Don’t worry I’ll explain parts of the code. Our goal is to make a shell script to create backups (in tar-gzip versions) of the folders we want unto a safe location on a disk. We want to be able to list all the folders and have the script loop through them. Now that’s settled, we can proceed …

Continue Reading

Linux: Snippet – Backup using Tar and gzip

As a programmer i have to make multiple revisions of a project on a remote site. Getting things wrong and messing up the files tend to happen more often than I am comfortable with. Fortunately, making quick backups in linux is a breeze. You can either make a folder and just copy your existing files via recursive cp command or; archive it using tar and gzip. Personally, I prefer archives since they tend to be smaller and easy to manage.

Continue Reading