≡ Menu

KSH HowTos & Tutorials

Learning the Korn Shell on Linux, OS X, and Unix like operating systems. Topic includes shell script programming, tips, customization, hacks and much more ( rss feed ).

Unix / Linux: Initialize Dot Files Without Restarting The Current Shell Session

I'm a new Linux, OS X or Unix-like system users. I'm using bash shell. I made changes to my $HOME/.profile ($HOME/.bash_profile) file. How can I restart my session without doing logout and login again?
[click to continue…]

Unix: Find Directory Name From Path

I am a new Unix shell programer. How can I extract the directory name from a full path (say /nas01/data/backups/file.tar.gz)? How do I get directory name from its path on a Linux or Unix-like system?
[click to continue…]

Linux/Unix: Find Command Ignore Case Insensitive Search

I am a new Linux and Unix-command line user. I am using find command to search file called "fooBar.conf.sample" in my home directory. I do not know the case, it could be uppercase, lowercase, or a mix of both. How can search a file and ignore case on a Linux or Unix-like system?
[click to continue…]

CentOS / RHEL: Install KornShell (KSH)

I am porting ksh script from Sun/Oracle Unix to Linux. How do I install ksh (KornShell) in CentOS / Fedora / Red Hat Enterprise Linux? How do I run and test ksh script on RHEL/CentOS Linux?
[click to continue…]

Unix and Linux: Redirect Error Output To null Command

I'm a new Linux system user. How can I redirect command error output /dev/null on a Linux or Unix-like system using Bash shell?
[click to continue…]

Linux / Unix: Shell Remove Empty Lines

I am a new Linux user. I have text files with lots of empty lines. How do I delete all empty lines under Linux or Unix operating systems?
[click to continue…]

Linux / Unix Shell Script: Get The Current Directory

I am working on a shell script. I need to find out the current working directory. How do I get the current working directory under Bash or Ksh shell running on Linux or Unix like operating systems?
[click to continue…]

Linux: Start Command In Background

I am a new Linux command line user. How do I start or run command in the background so that I can access command prompt immediately?
[click to continue…]

Linux / Unix: jobs Command Examples

jobs command

I am new Linux and Unix user. How do I show the active jobs on Linux or Unix-like systems using BASH/KSH/TCSH or POSIX based shell? How can I display status of jobs in the current session on Unix/Linux?
[click to continue…]

Linux / Unix: time Command Examples

time command

I am new Linux and Unix systems user. How do I display the time of the execution of a command/script on Linux or Unix-like operating systems using shell prompt?
[click to continue…]