Home Page Icon
Home Page
Table of Contents for
who—displays who is logged on the system
Close
who—displays who is logged on the system
by Ellie Quigley
Linux Shells by Example
Copyright
PREFACE
Acknowldgements
About the Author
Introduction to Linux Shells
Why Linux?
Definition and Function of a Shell
System Startup and the Login Shell
Processes and the Shell
The Environment and Inheritance
Executing Commands from Scripts
The Linux Tool Box
Regular Expressions
Combining Regular Expression Metacharacters
The Grep Family (Gnu & Sons)
The grep Command
Extended grep (grep -E or egrep)
Fixed grep (grep -F and fgrep)
Recursive grep (rgrep)
grep with Pipes
grep with Options
Linux Tools Lab 1
The Streamlined Editor
What Is sed?
Versions of sed
How Does sed Work?
Addressing
Commands and Options
Error Messages and Exit Status
sed Examples
sed Scripting
LINUX TOOLS LAB 2
Gawk Utility: Gawk as a Linux Tool
What's awk? What's nawk? What's gawk?
awk's Format
Formatting Output
awk Commands from within a File
Records and Fields
Patterns and Actions
Regular Expressions
awk Commands in a Script File
Review
Linux Tools Lab 3
The Gawk Utility: Evaluating Expressions
Comparison Expressions
Review
Linux Tools Lab 4
The Gawk Utility: Gawk Programming
Variables
Redirection and Pipes
Pipes
Closing Files and Pipes
Review
Linux TOOLS LAB 5
Conditional Statements
Loops
Program Control Statements
Arrays
awk Built-In Functions
User-Defined Functions
Review
Linux Tools Lab 6
Odds and Ends
Review
Linux Tools Lab 7
The Interactive Bash Shell
Introduction
Command Line Shortcuts
Variables
The Bourne Shell Lab Exercises
Programming with the Bash Shell
Introduction
Reading User Input
Arithmetic
Positional Parameters and Command Line Arguments
Conditional Constructs and Flow Control
Looping Commands
Functions
Trapping Signals
Debugging
Processing Command Line Options with getopts
The eval Command and Parsing the Command Line
Bash Options
Shell Built-In Commands
The Bash Shell Lab Exercises
The Interactive TC Shell
Introduction
The TC Shell Environment
Command Line Shortcuts
Job Control
Metacharacters
Redirection and Pipes
Variables
Arrays
Special Variables and Modifiers
Command Substitution
Quoting
Built-In Commands
The TC Shell Lab Exercises
Programming with the TC Shell
Steps in Creating a Shell Script
Reading User Input
Arithmetic
Debugging Scripts
Command Line Arguments
Flow Control and Conditional Constructs
Loops
Interrupt Handling
setuid Scripts
Storing Scripts
Built-In Commands
The TC Shell Lab Exercises
Useful Linux/UNIX Utilities for Shell Programmers
apropos—searches the what is database for strings
arch—prints the machine architecture (see uname -m)
at—at, atq, atrmbatch—execute commands at a later time
awk (gawk)—pattern scanning and processing language
banner—make posters
basename—with a directory name delivers portions of the pathname
bash—Gnu Bourne Again Shell
bc—processes precision arithmetic
biff [ny]—be notified if mail arrives and who it is from
cal—displays a calendar
cat—concatenates and displays files
chfn—change the finger information
chmod—change the permissions mode of a file
chown—change the user and group ownership of files
chsh—change your login shell
clear—clears the terminal screen
cmp—compares two files
compress—compress, uncompress, zcat compress, uncompress files, or display expanded files
cp—copies files
cpio—copy file archives in and out
cron—the clock daemon
crypt—encodes or decodes a file
cut—removes selected fields or characters from each line of a file
date—displays the date and time or sets the date
dd—converts a file while copying it
diff—compares two files for differences
dos, xdos, dosexec, dosdebug—a Linux dos emulator that runs MS-DOS and MS-DOS programs under Linux
df—summarizes free disk space
du-summarizes disk usage
echo—echoes arguments
egrep—searches a file for a pattern using full regular expressions
expr—evaluates arguments as an expression.
fgrep—search a file for a character string
file—determines the type of a file by looking at its contents
find—finds files
finger—displays information about local and remote users
fmt—simple text formatters
fold—folds long lines
ftp—file transfer program
free—displays amount of free and used memory in the system
fuser—identifies processes using files or sockets
gawk—pattern scanning and processing language
gcc, g++—Gnu project C and C++ Compiler (v2.7)
getopt(s)—parses command line options
grep—searches a file for a pattern (See Chapter 3)
groups—prints group membership of user
gzip, gunzip, zcat—compresses or expands files
head—outputs the first ten lines of a file(s)
host—prints information about specified hosts or zones in DNS
id—prints the username, user ID, group name, and group ID
jsh—the standard, job control shell
kill—sends a signal to terminate one or more processes
killall—kills processes by name
less—opposite of more
line—reads one line
ln—creates hard links to files
logname—gets the name of the user running the process
look—displays lines beginning with a given string
lp (ATT, Linux)—sends output to a printer
lpr (UCB, Linux)—sends output to a printer
lpstat (ATT)—prints information about the status of the LP print service
lpq (UCB, Linux)—prints information about the status of the printer
ls, dir, vdir—lists contents of directory
mail—mail, rmail—reads mail or send mail to users
mailx—interactive message processing system
make—maintains, updates, and regenerates groups of related programs and files
man—formats and displays the online manual pages
manpath—determines user's search path for man pages
mesg—permits or denies messages resulting from the write command
mkdir—creates a directory
more—browses or pages through a text file
mtools—utilities to access DOS disks in UNIX
mv—moves or renames files
nawk—pattern scanning and processing language
newgrp—logs in to a new group
news—prints news items
nice—runs a command at low priority
nohup—makes commands immune to hangups and quits
od—dumps files in octal and other formats
pack—pack, pcat, unpack—compresses and expands files
passwd—changes the login password and password attributes
paste—merges same lines of several files or subsequent lines of one file
pcat—(see "pack" on page706)
pine—a Program for Internet News and E-mail
pg—displays files a page at a time
pr—prints files
ping—reports if a remote system is reachable and alive
ps—reports process status
pstree—displays a tree of processes
pwd—displays the present working directory name
quota—displays users' disk usage and limits
rcp—remote file copy
rdate—get the date and time via the network
rgrep—a recursive, highlighting grep program
rlogin—remote login
rm—removes files from directories
rmdir—removes a directory
rsh—starts a remote shell
ruptime—shows the host status of local machines
rwho—who is logged in on local machines
script—creates a typescript of a terminal session
sed—stream editor (seeChapter 4)
size—prints section sizes in bytes of object files
sleep—suspends execution for some number of seconds
sort—sort and/or merge files
spell—finds spelling errors
split—splits a file into pieces
strings—finds any printable strings in an object or binary file
stty—sets the options for a terminal
su—become superuser or another user
sum—calculates a checksum for a file
sync—updates the superblock and sends changed blocks to disk
tabs—sets tab stops on a terminal
tail—displays the tail end of a file
talk—allows you to talk to another user
tar—stores and retrieves files from an archive file, normally a tape device
tee—replicates the standard output
telnet—communicates with a remote host
test—evaluates an expression and check file types
time—displays a summary of time used by this shell and its children
timex—times a command; reports process data and system activity
top—displays top CPU processes
touch—updates access time and/or modification time of a file
tput—initializes a terminal or queries the terminfo database
tr—translates characters
true—provides successful exit status
tsort—topological sort
tty—gets the name of the terminal
umask—sets file-creation mode mask for permissions
uname—prints name of current machine
uncompress—restores files to their original state after they have been compressed using the compress command
uniq—reports on duplicate lines in a file
units—converts quantities expressed in standard scales to other scales
unpack—expands files created by pack
uucp—copies files to another system, UNIX-to-UNIX system copy
uuencode—uuencode, uudecode—encodes a binary file into ASCII text in order to send it through e-mail, or convert it back into its original form
wc—counts lines, words, and characters
what—extracts SCCS version information from a file by printing information found after the @(#) pattern
which (UCB)—locates a command and displays its pathname or alias
whereis (UCB)—locates the binary, source, and manual page files for a command
who—displays who is logged on the system
write—writes a message to another user
xargs—constructs an argument list(s) and executes a command
zcat—uncompresses a compressed file to standard output. Same as uncompress –c
zipinfo—lists detailed information about a ZIP archive
zmore—file perusal filter for crt viewing of compressed text
Comparison of the Shells
tcsh versus csh
bash versus sh
Steps for Using Quoting Correctly
Backslash (see Table C.1):
Single Quotes (see Table C.1):
Double Quotes (see Table C.2):
Combining Quotes:
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
whereis (UCB)—locates the binary, source, and manual page files for a command
Next
Next Chapter
write—writes a message to another user
who—displays who is logged on the system
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset