Other Utilities

Here are some other commands that are useful to know.

Linux Command Description
clear Clear the screen
echo Display text on the screen. Mostly useful when writing shell scripts.
For example:

echo “Hello World”
more Display a file, or program output one page at a time.
Examples:

more mp3files.txt
ls -la | more
less An improved replacement for the “more” command. Allows you to scroll backwards as well as forwards.
grep Search for a pattern in a file or program output. For example, to find out which TCP network port is used by the “nfs” service, you can do this:

grep “nfs” /etc/services

This looks for any line that contains the string “nfs” in the file “/etc/services” and displays only those lines.

lpr Print a file or program output.
Examples:

lpr mp3files.txt (Print the mp3files.txt file)
ls -la | lpr (Print the output of the “ls -la” command)
sort Sort a file or program output.
Example:

sort mp3files.txt
su “Switch User”. Allows you to switch to another user’s account temporarily.
The default account to switch to is the root/superuser account.
Examples:

su -  (Switch the root account)
su -  (Switch to root, and log in with root's environment)
su larry (Switch to Larry's account)