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 am a new Ubuntu Linux and bash shell user. I also know how to redirect output from display/screen to a file using the following syntax:

cmd > file
ls > file

However, some time errors are displayed on screen. How do I store and redirect output from the computer screen to a file on a Linux or Unix-like systems?

{ 4 comments }

I‘m a new Linux system user. I need to cleanup in a download directory i.e. delete all files from ~/Downloads/ folders except the following types:

*.iso – All iso images files.
*.zip – All zip files.

How do I delete all file except some in bash shell on a Linux, OS X or Unix-like systems?

{ 13 comments }

I am a new Linux user and student who used to write C or C++ programs on MS-Windows. Now, I am using Ubuntu Linux. How can I compile a C or C++ program on Linux operating systems using bash Terminal application?

{ 6 comments }

I am a new Linux bash shell command line user. How can I view a text file using command line on a Linux or Unix-like operating systems? How can I view (open) binary files such as PDF or images on a Linux or Unix like system from command line?

{ 3 comments }

Ubuntu Linux version 14.04 LTS has been released. How do I upgrade to a newer version of Ubuntu 14.04 LTS from Ubuntu 13.10 or 12.04 LTS?

{ 38 comments }

I am a new Unix system shell user. I need to find and list all hidden files including directories on a Linux or Unix-like system. How can I recursively list all hidden files and directories? How do I save result in a text file?

{ 3 comments }

I‘m a new Apple OS X Mabbook user. I am getting an error which read as follows when I connect to any remote Linux/Unix/BSD server or machine through OS X ssh Terminal app:

ssh user@server1.cyberciti.biz
Last login: Wed Mar 26 08:45:36 2014 from 1.2.3.4
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

How do I fix this error?

{ 5 comments }