Tuesday, July 5, 2016

What Shell am I using?


Very simple, use any of the following methods:

Method# 1

$ echo $SHELL

Example:

[demo@localhost ~]$ echo $SHELL
/bin/bash

Note: SHELL is an environment or system variable, echoing its output will reveal what it contains.

Method# 2

$ echo $0

Example:

[demo@localhost ~]$ echo $0
bash


Note: The digit zero - "0" contains the name of the currently running program or script. So, at Shell Prompt, it will tell you the name of the Shell running. In a Shell Script, it will tell you the name of the Shell Script you are running.


Method# 3

$ grep ^user_name /etc/passwd

Example:

[demo@localhost ~]$ grep ^demo /etc/passwd
demo:x:500:500:demo user:/home/demo:/bin/bash


Note: The file "/etc/passwd" contains user accounts information, so the last field will contain the Shell Name with its path.

Method# 4

$ getent passwd user_name

Example:

[demo@localhost ~]$ getent passwd demo
demo:x:500:500:demo user:/home/demo:/bin/bash

Note: The command "getent" gets entries from administrative database. Here, we have specified "passwd" as the database to be used. This will list a non-local user account as well.

Wednesday, February 9, 2011

Send Email in Unix / Linux

Most distributions of Unix / Linux come with the mail program installed on it. I will show you how to send an email using the mail program.

Here's a fast-track information on the mail program:

-bash-2.05b# type mail

mail is hashed (/bin/mail)
-bash-2.05b# whatis mail
mail (1) - send and receive mail
-bash-2.05b#
Basic Usage of mail


Let's send an email that specifies the following:

A Subject Line
A List of Recepients
A Message (Body) 
-bash-2.05b# mail -s "Test Email" test,demo


Hi!




Kindly, ignore this test email.
.
Cc: root
-bash-2.05b#
  • -s specifies a Subject (Line) for the message being sent
  • After the subject we specify a comma separated list of recepients
  • Hitting Enter / Return places the cursor on the next line and we can type in our message
  • When we are done, we can type in a single dot (.) on a new line to signal "Go!" or "Send!"
  • However, the mail program may prompt us to include any recepient in the Cc: group (optional)
We can check the message in various ways. The mutt program is an easy to use tool that can be used for viewing and replying to emails. Another way is to directly display the contents of the mail file as shown below:


-bash-2.05b# cat /var/spool/mail/root

From root@host-6-9.linuxzoo.net Wed Feb 9 21:07:58 2011
Return-Path:
Received: from host-6-9.linuxzoo.net (localhost.localdomain [127.0.0.1])
by host-6-9.linuxzoo.net (8.12.11/8.12.11) with ESMTP id p19L7vLP002368;
Wed, 9 Feb 2011 21:07:57 GMT
Received: (from root@localhost)
by host-6-9.linuxzoo.net (8.12.11/8.12.11/Submit) id p19L7vPG002367;
Wed, 9 Feb 2011 21:07:57 GMT
Date: Wed, 9 Feb 2011 21:07:57 GMT
From: root
Message-Id: 201102092107.p19L7vPG002367@host-6-9.linuxzoo.net
To: test@host-6-9.linuxzoo.net, demo@host-6-9.linuxzoo.net
Subject: Test Email
Cc: root@host-6-9.linuxzoo.net

Hi!



Kindly, ignore this test email.

-bash-2.05b#

 The mail program itself can be used for viewing emails and performing actions on them as shown below:

 -bash-2.05b# mail

Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N 1 root@host-6-9.linuxz Wed Feb 9 21:07 20/698 "Test Email"
& 1
Message 1:
From root@host-6-9.linuxzoo.net Wed Feb 9 21:07:58 2011
Date: Wed, 9 Feb 2011 21:07:57 GMT
From: root
To: test@host-6-9.linuxzoo.net, demo@host-6-9.linuxzoo.net
Subject: Test Email
Cc: root@host-6-9.linuxzoo.net

Hi!


Kindly, ignore this test email.

& q
Saved 1 message in mbox
-bash-2.05b#

The mail program displays the messages from the default mail file and its & prompt accepts some commands specific to the mail program. In the above example, I have typed 1 to instruct it to display the 1st message. We can type ? to display the commands available.

Advanced Usage of mail


In this section, I will show you how to do more with mail than just sending emails from the command line.

Message Body Containing the Output of Another Command or Job:

uptime | mail -s "System Resource Availability" root -c demo

Here's a view from mutt program of the above message:

-bash-2.05b# su - demo

[demo@host-6-9 demo]$ mutt 

Date: Wed, 9 Feb 2011 21:27:29 GMT

From: root
To: root@host-6-9.linuxzoo.net
Subject: System Resource Availability
Cc: demo@host-6-9.linuxzoo.net

21:27:29 up 5:01, 1 user, load average: 0.15, 0.12, 0.09


Note: -c specifies recepients in the Cc (Carbon Copy) group.


Customized Settings for the mail Program:

We can create a local .mailrc file in the home directory. For example, to disable prompting for Cc: list, we can do the following:

-bash-2.05b# cat > .mailrc

unset askcc
-bash-2.05b# source .mailrc
-bash-2.05b# mail -s "Party Time" demo,test

Hi!

We're going to have party tonight!

Cheers!
.
EOT

Notice the "EOT" (End of Typing or Text) above. We can also hit Ctrl + d to insert the EOT instead of typing in the the dot (.).

To Store Outgoing Emails:
 
set record=$HOME/outgoing

To View the Contents of the "outgoing" (name it anything) file we have several methods:

cat outgoing

or

mail -f outgoing
Example:

First Method:

-bash-2.05b# mail -s "Outgoing Message" demo

Hi!
.
Cc:
-bash-2.05b# ls -l out
-rw-r--r-- 1 root root 76 Feb 11 21:31 out
-bash-2.05b# cat out
From root Fri Feb 11 21:31:21 2011
To: demo
Subject: Outgoing Message

Hi!

Second Method: 
-bash-2.05b# mail -f out
Mail version 8.1 6/6/93. Type ? for help.
"out": 1 message 1 new
>N 1 root Fri Feb 11 21:31 6/76 "Outgoing Message"
& 1
Message 1:
From root Fri Feb 11 21:31:21 2011
To: demo
Subject: Outgoing Message

Hi!

& q
"out" complete
The second method, as shown above, is more efficient.

Some Useful Tips:

The variable $MAIL contains the path to the  "postoffice" (file) which records incoming emails.

echo $MAIL

/var/spool/mail/root
man mail and info mail will give you details on the mail program.  
cat /usr/lib/mail.help contains a short description of the functionality available when using the mail program interactively.

Wednesday, December 1, 2010

Command Line History Tricks

Command: !!

Usage: Repeats the last command from the history.

Example:

-bash-2.05b# date
Wed Dec  1 20:16:13 GMT 2010
-bash-2.05b# !!
date
Wed Dec  1 20:16:19 GMT 2010
-bash-2.05b#

Command: !character


Usage: Repeats the last command that begins with "character" from the history.

Example:
-bash-2.05b# pwd
/root
-bash-2.05b# date
Wed Dec  1 20:17:56 GMT 2010
-bash-2.05b# uptime
 20:18:00 up  8:52,  1 user,  load average: 0.10, 0.11, 0.09
-bash-2.05b# !p
pwd
/root
-bash-2.05b#

Command: history


Usage: Displays the commands recorded in the history.


Command: !N


Usage: Executes the command recorded in the history and identified by the number (N) specified.

Running Jobs / Commands in Background and Foreground

I will discuss the following topics in this post:

  • How to run a job in background?
  • How to list background jobs?
  • How to send a job running in background to foreground?
  • How to send an already running foreground job to background?

How to run a job in background?

To run a job / command in background put an ampersand mark- & at the end of the job name or command separated by a space as shown below:

-bash-2.05b# top &
[1] 1514
-bash-2.05b# vi web.log &
[2] 1515

[1]+  Stopped                 top
-bash-2.05b#

How to list background jobs?

To view the jobs we have run in background, type jobs as shown below:

-bash-2.05b# jobs
[1]-  Stopped                 top
[2]+  Stopped                 vim web.log
-bash-2.05b#

When we run a job in background with & its PID is shown along with the job number as shown above. However, the PID is not shown in the output generated by the command jobs. We can use -l with jobs to display the PID and the status of the job as shown below:
-bash-2.05b# jobs -l
[1]-  1514 Stopped (tty output)    top
[2]+  1515 Stopped (tty output)    vim web.log
-bash-2.05b#

How to send a job running in background to foreground?


To send the job in foreground we can use its job number as shown below:

-bash-2.05b# fg 1

The above command would send the job "top" in the foreground and it would become the currently active job.


How to send an already running foreground job to background?


Let's first execute a job as usual in foreground:

-bash-2.05b# watch -d uptime

The above command would run in real-time. To get back to the Shell Prompt we can hit Ctrl and z simultaneously that stops the job as shown below:


[1]+  Stopped                 watch -d uptime
-bash-2.05b# jobs -l
[1]+  1557 Stopped                 watch -d uptime
-bash-2.05b#

We can then resume the job in background by issuing the following command:

-bash-2.05b# bg 1
[1]+ watch -d uptime &
-bash-2.05b#

Notice the ampersand symbol "&" above it is same as:
-bash-2.05b# watch -d uptime &
[2] 1560
-bash-2.05b# jobs -l
[1]-  1557 Stopped (tty output)    watch -d uptime
[2]+  1560 Stopped (tty output)    watch -d uptime
-bash-2.05b#

Note: Hitting Ctrl + c cancels the job. Use Ctrl + z to stop the job as shown above.

Thursday, October 21, 2010

Creating, Editing, and Viewing Text Files with Vim Editor


Vi / Vim Editor


Please note: This post is not completed yet.



 In this post I will show you how to:

  • create a text file or view an existing text file for editing
  • insert new lines / blank lines
  • navigate through the pages of a text file and move around it 
  • go to a specific line number 
  • search for a specific piece of text or information in a text file while it is opened
  • copy, cut, and paste text
  • set certain features on / off

Introduction

Vim is the improved or enhanced version of Vi Text Editor. It is available in most Unix and Linux Operating Systems by default. Its beauty lies in the fact that we can use it in both GUI (Graphical User Interface) and CLI (Command Line Interface) modes.

The Vim Editor can be used for a variety of purposes:
  • to create and edit plain text files
  • to write scripts or codes in a particular Computer Programming Language such as Perl and C
  • to write web pages in HTML  
Its code colorization or syntax highlighting also helps in recognizing keywords and constants (I will cover them in some other post) written in Shell Script or PHP or any other scripting language.

Normally vi would use vim. Please see this note:

$ whatis vim
vim                  (1)  - Vi IMproved, a programmers text editor
$ type vi
vi is aliased to `vim'
$ type vim
vim is /usr/bin/vim
 Vim Editor has these three modes:
  • Escape Mode 
    • This is the default mode in which Vim opens a named file. In the Escape Mode we can move around the file and perform deletion, copying, and pasting of specific text or lines.
  • Insert Mode 
    • This is the mode which is used for editing a text file. 
  • Command Mode
    • This mode is useful for saving an opened file, exiting from Vim, searching for a piece of text in the file, and for environment settings such as turning Line Numbering On or Off.
 How to create a text file or view an existing text file for editing?

Command: vi or vim

Usage:

$ whatis vim
vim                  (1)  - Vi IMproved, a programmers text editor

Examples: 
$ vi helloWorld
or

$ vim helloWorld
A window or view opens and at the bottom the following line is displayed:

"helloWorld" [New File]                                       0,0-1         All
Note:
If the named file existed then it would be opened or else a new file would be created as shown above.

To begin tpying in, hit i or Shift + i 

To save your work and exit from the Vim Editor, hit Esc and Shift + : and type wq and hit the Enter Key. 

To display the contents of the text file we have just created, we can use the cat command: 

$ cat helloWorld
Hello World!
How to insert a new / blank line?

Open a text file:

-bash-2.05b# vi hellWorld


|Vim is an enhanced version of Vi.
It is found on almost all Unix and Linux system.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"hellWorld" 2L, 83C                                           1,1           All

To insert a blank line below the current line, first make sure that we are in the Escape mode. Hit Esc. Now hit o to insert a new line as shown below:

Vim is an enhanced version of Vi.
|
It is found on almost all Unix and Linux system.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
-- INSERT --                                                  2,1           All

The cursor is placed on the second line and the INSERT mode is opened. We cab begin typing here.

To insert a blank line above the current line, hit Esc to close the INSERT mode and return to Escape mode. Now hit O (Shift + o) as shown below:

Vim is an enhanced version of Vi.
|
It can be used for editing a text file easily.
It is found on almost all Unix and Linux system.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
-- INSERT --                                                  2,1           All
 Once again we are in the INSERT mode and the cursor is placed on the newly created / inserted blank line.

Save your work by hitting Shift + : and typing w and then hitting the Enter Key. To quit from the Vi editor, hit Shift + : and type q and then hit the Enter Key.


To save and quite in one go following this procedure: Shift + :wq




Tuesday, October 19, 2010

Creating & Removing Directories & Files

Unix / Linux - Getting Started


In this post I will show you how to

  • create a directory
  • change a directory or directory path
  • show the current / present working directory or path and switch between the current and the previous directories or paths
  • create a plain text  file
  • delete  a directory, a file, and a directory structure completely

Command: mkdir

Usage:

$ whatis mkdir
mkdir                (1)  - make directories
mkdir                (2)  - create a directory
$

Examples:

$ mkdir scripts
The above command creates an empty directory and name it scripts.


We can also define a sub-directory to be created beneath the top directory or in a specified directory path:

$ mkdir first/second/third
mkdir: cannot create directory `first/second/third': No such file or directory





As the specified directories first and second do not already exist or the path is invalid so we need to use the option "-p" to create the parent directories as well:


$ mkdir -p first/second/third



Let's check the contents of the parent directory first by recursively listing the directory contents:


$ ls -R first/
first/:
second

first/second:
third

first/second/third:
$


Command: cd

Usage:

$ whatis cd
cd [builtins]        (1)  - bash built-in commands, see bash(1)
$

Examples:


$ cd first
The above changes directory to first if it is found in the current directory / location or path. We can specify a path also:

$ cd /tmp/samples


Command: pwd

Usage:

$ whatis pwd
pwd                  (1)  - print name of current/working directory
pwd [builtins]       (1)  - bash built-in commands, see bash(1)
$


Examples:

$ pwd
/tmp/samples
$
The above command shows the complete path to our current working directory (CWD). We can check the previous directory name by using a special environmental or system variable "OLDPWD" as shown below:

 $ echo $OLDPWD
/root

Conversely we can use a variable that gives us the same information as produced by the command pwd:

$ echo $PWD
/tmp/samples
Let's change our current directory and go back in the previous one:

$ cd -
/root
$
Please note the hyphen "-" after "cd". We could have as well used:

$ cd /root

To directly go to the home directory we can use the option "~" or simply type "cd" without any option:

$ pwd
/tmp/samples
$ cd ~
$ pwd
/root

$ cd -
/tmp/samples
$ cd
$ pwd
/root

Command: rmdir

Usage:

$ whatis rmdir
rmdir                (1)  - remove empty directories
rmdir                (2)  - delete a directory
$

Examples:

 $ pwd
/root/first/second
$ ls -R
.:
third

./third:
$ rmdir third
$ ls -R
.:

The command "rmdir" deletes or removes only an empty directory.


$ rmdir first/
rmdir: `first/': Directory not empty
$
To recursively delete a directory structure we can pass the "-r" option to the command "rm" as shown below:

$ rm -r first/

Command: rm

Usage:

$ whatis rm
rm                   (1)  - remove files or directories
$

Examples:

$ rm hi
We can pass "-i" to interactively remove a file or directory:

$ rm -i hello
rm: remove regular empty file `hello'? y
We can pass "-f" to forcefully remove a file or directory, and "-r" to recursively delete a directory and all its sub-directories and files in one go.

Command: touch


Usage:

$ whatis touch
touch                (1)  - change file timestamps
$

Examples:

$ touch HelloWorld

The above command creates a plaint text file and name it "HelloWorld". The file contains nothing, i.e. it's empty.

$ touch HelloWorld
$ ls -l HelloWorld
-rw-r--r--  1 root root 0 Oct 20 21:38 HelloWorld

Had the file already been created, its time-stamp would have been updated:
$ touch HelloWorld
$ ls -l HelloWorld
-rw-r--r--  1 root root 0 Oct 20 21:39 HelloWorld
$ touch HelloWorld
$ ls -l HelloWorld
-rw-r--r--  1 root root 0 Oct 20 21:40 HelloWorld
For creating a text file that can contain some text or data we can use "cat" whose primary function is to concatenate and display contents of text files.


Command: cat


Usage:

$ whatis cat
cat                  (1)  - concatenate files and print on the standard output


Examples:

$ cat > HelloWorld
Hello, world!
This is a plain text file.

<Hit Ctrl + c to Cancel Entering Text or Ctrl + d to Terminate the Operation>
Let's display the contents of the file we created above:

$ cat HelloWorld
Hello, world!
This is a plain text file.
Note:

  • We do not use the greater then  ">" symbol after cat when we want to display the contents of the file. The angle bracket ">" acts as an Input Redirection Operator. The input is coming from the commonly used standard input device, i.e. the computer keyboard.
  • On some systems hitting Ctrl + d may terminate the log-in session as it is also used to Exit / Log off from an opened session. 
  • cat > fileName creates a new file if it doesn't already exist. If it exists then its contents are overwritten.

Let's create two text files and enter some data, and then concatenate them and display their contents:

$ cat > OS
Unix
Linux
Mac
<Hit Ctrl + c>

$ cat > Desktop
KDE
GNOME
CDE
<Hit Ctrl + c> 

$ cat OS Desktop
Unix
Linux
Mac
KDE
GNOME
CDE
For creating, editing, and viewing of text files and searching for a specific piece of information or text in them we use a Text Editor such as Vi or Vim and Emacs. I will cover them in some other post.

Directory Listing with the Command "ls"

Unix / Linux - Getting Started


Here I am going to show you some frequently used commands on a Unix / Linux running computer system.

In this post we will see how to do a directory listing of files and directories.

Command: ls [Options] [FileOrDirectoryName]
Usage: 

$ whatis ls
ls                   (1)  - list directory contents

Examples:


$ ls
bin  bin.tar.bzip2  co  contacts  contacts-new  hello  hi  Mail  man  mbox  mysql-init  test
$

Only directory and file names are listed. No extra or detailed information is displayed along with them.

We can also pass a file or directory name along with ls

$ ls bin
case      child.sh    contacts     hello     parent.sh    readLine.sh   variable.sh
case.man  compVar.sh  dumpHTML.sh  manifest  readFile.sh  scriptPid.sh
$
In the above example we have passed the directory name "bin" as the argument to the command ls so that its contents are displayed.

We can also pass a file name. If it exists then the file name itself is echoed otherwise we get an error:

$ ls contacts
contacts
$ ls salary
ls: salary: No such file or directory
$
For a detailed information we can use "-l" option:



$ ls -l
total 48
-rwxr-xr-x  1 root root 243 Aug 26 19:15 case
-rw-r--r--  1 root root 289 Aug 26 19:51 case.man
-rwxr-xr-x  1 root root  26 Aug 30 16:28 child.sh
-rw-r--r--  1 root root 402 Aug 31 16:20 compVar.sh
-rw-r--r--  1 root root 162 Aug 30 18:58 contacts
-rwxr-xr-x  1 root root 376 Sep  2 20:59 dumpHTML.sh
-rw-r--r--  1 root root   0 Sep  5 18:59 hello
-rwxr-xr-x  1 root root 156 Aug 27 14:22 manifest
$


To include hidden files (file and directory names that begin with a dot ".") we can pass "-a" option:


$ ls -a
.              .bashrc        contacts        .gstreamer-0.8  Mail            mysql-init  .Xauthority
..             bin            contacts-new    .gtkrc          man             .ssh
.bash_history  bin.tar.bzip2  .fonts.cache-1  hello           mbox            test
.bash_profile  co             .gnome          hi              .mysql_history  .viminfo
$

Sorting the directory list displaying largest to smallest files and directories:

$ ls -lS
total 64
-rw-r--r--  1 root root 10240 Oct  6 21:50 hello
-rw-r--r--  1 root root 10240 Oct  6 21:54 hi
drwxr-xr-x  2 root root  4096 Sep  5 18:59 bin
drwx------  2 root root  4096 Sep 26 15:34 Mail
drwxr-xr-x  3 root root  4096 Aug 26 20:59 man
drwxr-xr-x  3 root root  4096 Sep 17 14:22 test
-rw-r--r--  1 root root  1739 Oct  6 22:12 bin.tar.bzip2
-rw-------  1 root root   784 Sep 26 15:34 mbox
-rw-rw-rw-  1 root root   218 Oct 10 16:13 contacts
-rw-r--r--  1 root root   210 Oct 10 16:04 contacts-new
-rw-r--r--  1 root root   207 Oct  6 22:02 co
-rw-r--r--  1 root root    85 Sep 21 18:53 mysql-init
$
Sorting the directory list displaying newest to oldest files and directories:
 $ ls -lt
total 64
-rw-rw-rw-  1 root root   218 Oct 10 16:13 contacts
-rw-r--r--  1 root root   210 Oct 10 16:04 contacts-new
-rw-r--r--  1 root root  1739 Oct  6 22:12 bin.tar.bzip2
-rw-r--r--  1 root root   207 Oct  6 22:02 co
-rw-r--r--  1 root root 10240 Oct  6 21:54 hi
-rw-r--r--  1 root root 10240 Oct  6 21:50 hello
-rw-------  1 root root   784 Sep 26 15:34 mbox
drwx------  2 root root  4096 Sep 26 15:34 Mail
-rw-r--r--  1 root root    85 Sep 21 18:53 mysql-init
drwxr-xr-x  3 root root  4096 Sep 17 14:22 test
drwxr-xr-x  2 root root  4096 Sep  5 18:59 bin
drwxr-xr-x  3 root root  4096 Aug 26 20:59 man
To reverse the  sorting, i.e. to sort in descending order, we can use "-r" option. We can use any combination of options. For example to display all the files and directories, including the hidden ones, from oldest to newest we can issue the following command:


$ ls -alrt
total 132
drwx------   2 root root  4096 Jul 27  2004 .gnome
drwxr-xr-x   2 root root  4096 Jul 27  2004 .gstreamer-0.8
-rw-r--r--   1 root root    59 Sep 16  2004 .fonts.cache-1
-rw-r--r--   1 root root   120 Oct 25  2004 .gtkrc
drwx------   2 root root  4096 Mar 29  2005 .ssh
-rw-------   1 root root   259 Mar 29  2005 .Xauthority
-rw-r--r--   1 root root   207 Aug 26 20:58 .bash_profile
drwxr-xr-x   3 root root  4096 Aug 26 20:59 man
drwxr-xr-x   2 root root  4096 Sep  5 18:59 bin
drwxr-xr-x   3 root root  4096 Sep 17 14:22 test
-rw-r--r--   1 root root    85 Sep 21 18:53 mysql-init
drwx------   2 root root  4096 Sep 26 15:34 Mail
-rw-------   1 root root   784 Sep 26 15:34 mbox
-rw-r--r--   1 root root 10240 Oct  6 21:50 hello
-rw-r--r--   1 root root 10240 Oct  6 21:54 hi
-rw-r--r--   1 root root   207 Oct  6 22:02 co
-rw-r--r--   1 root root  1739 Oct  6 22:12 bin.tar.bzip2
-rwxr-xr-x   1 root root    50 Oct  8 15:44 .bashrc
-rw-r--r--   1 root root   210 Oct 10 16:04 contacts-new
-rw-rw-rw-   1 root root   218 Oct 10 16:13 contacts
-rw-------   1 root root  6215 Oct 10 16:13 .viminfo
drwxr-xr-x  19 root root  4096 Oct 19 19:13 ..
-rw-------   1 root root  3107 Oct 19 19:55 .mysql_history
-rw-------   1 root root 11437 Oct 19 19:55 .bash_history
drwxr-xr-x   2 root root  4096 Oct 19 20:29 .hidden
drwxr-xr-x  10 root root  4096 Oct 19 20:29 .
 By default only directory names are displayed, i.e. their contents are not displayed. To display sub-directories and their contents recursively we can use "-R" option as shown below:

$ ls -R
.:
bin  bin.tar.bzip2  co  contacts  contacts-new  hello  hi  Mail  man  mbox  mysql-init  test

./bin:
case      child.sh    contacts     hello     parent.sh    readLine.sh   variable.sh
case.man  compVar.sh  dumpHTML.sh  manifest  readFile.sh  scriptPid.sh

./Mail:

./man:
case.l.gz  cat1

./man/cat1:

./test:
tube

./test/tube:
go  goback  year
$
There are many other options available with the command "ls". We can check out the manual page by issuing the following command:

$ man ls