Lab: Access the Command Line
In this lab, you use the Bash shell to execute commands.
Outcomes
Successfully run simple programs from the Bash shell command line.
Execute commands to identify file types and to display parts of text files.
Practice using some Bash command history shortcuts to more efficiently repeat commands or parts of commands.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start cli-reviewInstructions
Use the
datecommand to display the current time and date.Display the current time in 24-hour clock time (for example, 13:57). Hint: The format string that displays that output is
%R.What kind of file is
/home/student/zcat? Is it readable by humans?Use the
wccommand and Bash shortcuts to display the size of thezcatfile.Display the first 10 lines of the
zcatfile.Display the last 10 lines of the
zcatfile.Repeat the previous command exactly with four or fewer keystrokes.
Use the
tailcommand-n 20option to display the last 20 lines in the file. Use command-line editing to accomplish this task with a minimal number of keystrokes.Use the shell history to run the
date +%Rcommand again.
This concludes the section.
No comments:
Post a Comment