Homework: Linux Command Line
Boot the PC using the Knoppix 5.1 LiveCD distributed in class.
Open a terminal window and answer the following questions.
[NOTE: You may use information from your class notes, the
Internet, your textbook or other reference books to find out about the commands
needed to complete these exercises. You should write down
the specific commands used on a printout of this assignment, but must word
process your answers to hand in.]
- Who are you currently logged in as?
_________________________
- What is the current directory?
______________________________
- Change directories to the root directory.
What command did you use? _______________________________
- Get a listing of the files in this
directory
What command did you use? _______________________________
- Change to the directory where
configuration files are kept.
Get a listing of the files in this directory showing file details.
Look for a file called services.
What permissions does it have? _____________________________
Who owns it? ____________________________________________
What group does it belong to? ________________________________
- Become root.
What is root's home directory? _______________________________
- Create an empty file called "demo" in
root's home directory.
What command did you use? _________________________________
- Change the permissions on demo so that
everyone can read, write, and execute it.
What command did you use? _________________________________
- Edit the file so that it contains the
following lines:
date
whoami
pwd
echo $PATH
Save and quit.
At the command line type demo.
What appeared on your screen? ______________________________
_________________________________________________________
Why? ___________________________________________________
_________________________________________________________
- Rename the demo file to be called go130
Get a list of files in the current directory
What files were shown in the listing? __________________________
- Copy the file go130 to the directory where
temporary files are kept.
What command did you use? ________________________________
- Change to the directory where temporary
files are kept.
Get a listing of all of the files in the current directory
Besides the file go130, what else is there? _______________________
- Change to the directory where device files
are kept
Get a listing of files including all details and make it display one
page at a time.
What command did you use? ____________________________________
What type of file is hda? _______________________________________
What type of file is tty1? ______________________________________
- Shutdown the PC from the command line.
What command did you use? ___________________________________