Exercise: Working with the Shell
Try these shell commands at the prompt. Many of these commands have extensive optional arguments.
Display $PATH, the value of the PATH variable
The PATH
environment variable stores designated paths to executables;
as a result, these executables can be executed without reference to their full paths. Commonly used paths are added to this environment variable by the system at startup.
Later we will see how to add additional paths to the environment variable. Executables in directories included in $PATH
are often referred to as being "in the path" of the current shell.
List the available shells in the system
The cat
(concatenate)
command is a standard Linux utility that concatenates and prints the content
of a file to standard output (shell output). In this case, shells is
the name of the file, and /etc/ is the pathname of the directory where
this file is stored.
Find the current date and time of the system
Use the date
command.
List all of your own current running processes
Use the ps
command (process status).
In Linux, each process is associated with a PID
or process identifier.