≡ 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 )

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…]

I download lots of files in ~/Downloads/ folder in Ubuntu Linux and OS X desktop. How do I show last downloaded file first using the ls command?
[click to continue…]

I need to find out in which directory my bash script resides so that I can read config file called .backup .ignore .target. For example, if my script resides in >/home/foo/script.sh, I need to read /home/foo/.{backup,ignore,target} files. How do I find out the current directory location and shell script directory location in Bash running on Linux or Unix like operating systems?
[click to continue…]