The above will echo out the name of the shell. For example the output may be:$ echo $0
Alternatively to get the full path to the shell processor, do the following:-bash
$ echo $SHELL
List each item with full attributes$ ls
To list even files that begin with "." because these are normally hidden$ ls -l
$ ls -l -a
To list files that begin with "." but excluding the implied directory names of "." (current) or ".." (parent)$ ls -l -A
A file name or directory name, with or without wildcards ('*" or "?"), may be be provided to get directory limited to files or directories that match.
$ ls -l -A <filename>
If shell is set up for it (Bash usually is), then the easier to remember "dir" command can be used$ dir -l -A
For extensive help (when available) use the "man" command:$ dir --help
The above command will list out a manual article on the "set" command$ man set
A wildcard will make this quicker and easier to type if "public_html" is the only directory that begins with "pub"$ cd public_html
$ cd pub*
$mkdir <directory name>
Variable PS1 defines the prompt string for Bash. With special escape character "\" commands cause system values to be inserted. A good explanation for this was found at on the web here.
Just set the TERM variable
The first command will cause all subsequently created or modified variables to be exported
The next command will specify a list of names to export$ set -a
$ export <names>
In the below example, the "&" indicates that the given command has a requirement for terminal access
$ <command> &
The following will list all processes user is allowed to view based on authorization level
A root user would be able to see all processes running on the system with the above. A non-privileged user would only be able to see his own.$ ps -e
Use --help to see more options.
Execute a command as another user
This is may be allowed only if a privileged user. Also may prompt for password.su -c "<command>" <userid>
Sending the output of one command to be processed by another, use the pipe character "|". The standard output of 1st (normally printed on terminal display) of will be sent as the standard input (normally from terminal keyboard) to the 2nd.
Example using grep processor to list out any running process that contains a certain string ("bash") in its name
$ ps -e | grep "bash"
Pipe output to "more" processor
The above list all variables ("set") by sending one page of output to the terminal at a time. Key "q" or cntrl-c to stop. Any other key will go to next page.$ set | more
A better processor to use is "less"
$ set | less
The above will list all variables by 1st sending 1st page of output to the terminal. The "q" key will stop. Keyboard up and down arrow keys will allow navigating up and down one line at a time. Space key will move a page at a time. Other keys may do other things so look this up in "man" or use
$ less --help