Performance Checklist
In this lab, you will use the Bash shell to efficiently execute commands using shell metacharacters.
| Resources: | |
|---|---|
| Files: |
/usr/bin/clean-binary-files
|
Outcomes
Practice using shell command line editing and history functions to efficiently execute commands with minor changes.
Change the password of the student user to
T3st1ngT1me.
Execute commands used to identify file types and display parts of text files.
Reset your desktopX system. Perform the following steps on desktopX.
Log into your desktopX system's graphical login
screen as student.
Open a terminal window that will provide a bash prompt.
Change student's password to T3st1ngT1me.
Use the passwd command to change
the password. Be sure to provide the original password,
student, first.
[student@desktopX ~]$passwdChanging password for user student. Changing password for student. (current) UNIX password:studentNew password:T3st1ngT1meRetype new password:T3st1ngT1mepasswd: all authentication tokens updated successfully.
Display the current time and date.
Display the current time in the following format: HH:MM:SS A/PM. Hint: The format string that displays that output is %r.
What kind of file is
/usr/bin/clean-binary-files? Is it readable
by humans?
Use the wc command
and bash shortcuts to display the size of
/usr/bin/clean-binary-files.
Display the first 10 lines of
/usr/bin/clean-binary-files.
The head command displays the beginning of the file. Did you use the bash shortcut again?
[student@desktopX ~]$head <Esc>.[student@desktopX ~]$head /usr/bin/clean-binary-files#!/bin/sh # # Script to clean binary files. # # JPackage Project <http://www.jpackage.org/> # # $Id: clean-binary-files,v 1.1 2006/09/19 19:39:37 fnasser Exp $ # Import java functions [ -r "/usr/share/java-utils/java-functions" ] \
Display the last 10 lines at the bottom of the
/usr/bin/clean-binary-files file.
Repeat the previous command, but use the -n 20 option to display the last 20 lines in the file. Use command line editing to accomplish this with a minimal amount of keystrokes.
Execute the date command without any arguments to display the current date and time.
Use bash history to display just the time.
Finish your session with the bash shell.