Bash Shell Programming HowTos

Tutorials, howtos and programming tips about GNU Bourne-Again SHell (BASH) for Apple OS X, Linux, *BSD and Unix like operating systems. ( rss feed )

How do I minify and compress CSS & JS files on Linux or Unix-like system using shell prompt on my server? How can I minify JavaScripts and stylesheets at shell promot so they can download faster over the Internet without using any online tools?

{ 4 comments }

I often see commands as follows posted on blog or forums

cp /etc/httpd/httpd.{,.bakup}

OR

mv resume{z,}.doc

What is the purpose of {,} in Linux and Unix shell commands?

{ 11 comments }

I‘m a new Ubuntu Linux user. This seems like a newbie question, but I can not seem to find examples to copy files on Ubuntu. How do I copy file to another directory on Ubuntu Linux using command line terminal application? How can I copy files via terminal on Ubuntu Linux desktop?

{ 8 comments }

Recently, I switched from MS-Windows based web-server to CentOS Linux based Apache web-server. All user uploaded files are stored in /var/www/uploads/ directory. Is there command that can give me a list of files that have been added to the filesystem at /var/www/uploads/ in last 7 days on Linux/Unix-like oses?

{ 5 comments }

whereis command

I am a new Linux and Unix-like system command line user. How do I find and locate the binary, source, and manual page files for a given command?

{ 4 comments }

I recently learned that “wget” can continue getting a partially-downloaded (resume download) file. I am unable to find wget command on Mac OS X. How do I install install wget on Mac OS X (Mountain Lion/ Mavericks / Snow Leopard)? How can I install wget in Mac OS X without 3rd-party repo such as Homebrew or MacPorts?

{ 9 comments }

I see lots of seasoned admins and cloud provider wrapper scripts use ssh client command as follows in shell:

ssh nixcraft@server1.cyberciti.biz --

What the double -- does here? Why it is used in this shell command and why not just use the following?

ssh nixcraft@server1.cyberciti.biz

{ 3 comments }