≡ Menu

BASH Shell

Bash Shell: Find Out If a Variable Is Empty Or Not

My shell script depends upon user input. How do I find out if a variable called $_JAIL path is empty under Linux / Apple OS X / Unix like operating systems?
[click to continue…]

Sysadmin because even developers need heroes!!!

Bash Shell Script To Test For Empty Folder

How do I check if a directory contains files? How do I find out if a directory contains files using bash shell under Linux or Unix like operating systems?
[click to continue…]

Linux / Unix: Find Hidden Directories, Files and Folders

I‘m a new Unix user and trying to find the hidden directory called .movies but I do not know where it is on the file system. How do I find a hidden folder or directories under Unix like operating systems?
[click to continue…]

Unix / Linux Shell: Parse Text CVS File Separator By Field

I work for a small ISP (Internet Service Provider) and we are using Linux and Unix-like operating system with bash shell. I want to write a shell script to parse the csv file line by line. Then line must be parse again field by field. The sample input file is as follows:

example.com,username,groupname,homedir,md5password,permission,secondarygroup

I need to extract each of these example.com,username,groupname,homedir,md5password,permission,secondarygroup fields and passed to the different system utilities. How do I write a shell script to automate this task and use the bash shell to parse a text file?
[click to continue…]

Linux / Unix: Generate A MD5 String

I need to generate a md5 hash for given string. It will be used by shell script to generate keys for remote web service or cryptographic application. How do I generate a md5 hash based on any input string under Linux or Unix like operating systems?
[click to continue…]

HowTo: Iterate Bash For Loop Variable Range Under Unix / Linux

How can I iterate bash for loop using a variable range of numbers in Unix or Linux or BSD or Apple OS X operating systems?
[click to continue…]

Linux: HowTo Copy a Folder [ Command Line Option ]

I‘m a new Linux user. How do I copy a directory or folder under Linux operating system using command line options and bash shell?
[click to continue…]

Linux / Unix Shell: Set Default Printer

How do I set default printer in my Bash shell under CentOS Linux or FreeBSD unix desktop operating systems?
[click to continue…]

Bash Shell: Find Out If a Variable Is Set or Not

How do I check if a bash shell variable called $input is defined or not under BSD / Apple OS X / Unix / Linux like operating systems?
[click to continue…]

Linux / Unix: Bash Shell Assign Printf Result To Variable

How do I assign printf command result to a shell variable under Unix like operating systems?
[click to continue…]