≡ Menu

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 )

Explain: {,} in cp or mv Bash Shell Commands

I often see commands as follows posted on blog or forums

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


mv resume{z,}.doc

What is the purpose of {,} in Linux and Unix shell commands?
[click to continue…]

Ubuntu Copy File Command

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?
[click to continue…]

Unix / Linux: Check New Files In File System /var/www/uploads/

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?
[click to continue…]

Linux / Unix: whereis Command Examples

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?
[click to continue…]

Mac OS X: Install wget Network Downloader Utility

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?
[click to continue…]

What Does –– (double dash) Mean In SSH Shell Command?

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 -- (dash) does here? Why it is used in this shell command and why not just use the following?

ssh nixcraft@server1.cyberciti.biz
[click to continue…]

HowTo: Unpack .tgz File On Linux

I am a new Linux user. I am having problem with the Terminal. How do I unpack .tgz (tar.gz) file on Linux using command line options?
[click to continue…]

Mac OS X: Terminal Download File Command

I often need to download files using the Terminal. However, I am unable to find the wget command on OS X. How do download files from the web via the Mac OS X bash command line option?
[click to continue…]

OpenSSH Config File Examples

How do I create and setup an OpenSSH config file to create shortcuts for servers I frequently access under Linux or Unix desktop operating systems?
[click to continue…]

Mac OS X: Set / Change $PATH Variable

I need to add dev tools (such as JDK and friends) to my PATH. How do I change $PATH variable in OS X 10.8.x? Where does $PATH get set in OS X 10.8 Mountain Lion?
[click to continue…]