18.11.2012 Views

3 - Weber State University

3 - Weber State University

3 - Weber State University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

130 Chapter 3 Exploring Linux Filesystems<br />

3. At the command prompt, type ls and press Enter. What do you see listed in the four<br />

columns? Do any of the files have extensions? What is the most common extension<br />

you see and what does it indicate? Is the list you are viewing on the screen the entire<br />

contents of /etc?<br />

4. At the command prompt, type ls | more and then press Enter (the | symbol is usually<br />

near the Enter key on the keyboard and is obtained by pressing the Shift and \ keys in<br />

combination). What does the display show? Notice the highlighted --More-- prompt at<br />

the bottom of the screen. Press Enter. Press Enter again. Press Enter once more. Notice<br />

that each time you press Enter, you advance one line further into the file. Next, press<br />

the Spacebar. Press the Spacebar again. Notice that with each press of the Spacebar,<br />

you advance one full page into the displayed directory contents. Press the h key to get<br />

a Help screen. Examine the command options.<br />

5. Press the q key to quit the more command and return to an empty command prompt.<br />

6. At the command prompt, type ls | less and then press Enter. What does the display<br />

show? Notice the : at the bottom of the screen. Press Enter. Press Enter again. Press<br />

Enter once more. Notice that each time you press Enter, you advance one line further<br />

into the file. Next, press the Spacebar. Press the Spacebar again. Notice that with each<br />

press of the Spacebar, you advance one full page into the displayed directory contents.<br />

Press the h key to get a Help screen. Examine the command options, and then press q<br />

to return to the command output.<br />

7. Press the ↑ (up cursor key) key. Press ↑ again. Press ↑ once more. Notice that each time<br />

you press the ↑ key, you go up one line in the file display toward the beginning of the<br />

file. Next, press the ↓ (down arrow) key. Press ↓ again. Press ↓ once more. Notice that<br />

each time you press the ↓ key, you move forward into the file display.<br />

8. Press the q key to quit the less command and return to a shell command prompt.<br />

9. At the command prompt, type cd and press Enter. At the command prompt, type pwd<br />

and press Enter. What is your current working directory? At the command prompt,<br />

type ls and press Enter.<br />

10. At the command prompt, type ls /etc and press Enter. How does this output compare<br />

with what you saw in Step 9? Has your current directory changed? Verify your<br />

answer by typing pwd at the command prompt and pressing Enter. Notice that you<br />

were able to list the contents of another directory by giving the absolute name of it as<br />

an argument to the ls command without leaving the directory in which you are currently<br />

located.<br />

11. At the command prompt, type ls /etc/skel and press Enter. Did you see a listing of<br />

any files? At the command prompt, type ls -a /etc/skel and press Enter. What is<br />

special about these files? What do the first two entries in the list (. and ..) represent?<br />

12. At the command prompt, type ls -aF /etc/skel and press Enter. Which file types<br />

are available in the /etc/skel directory?<br />

13. At the command prompt, type ls /bin and press Enter. Did you see a listing of any<br />

files? At the command prompt, type ls -F /bin and press Enter. What file types are<br />

present in the /bin directory?<br />

© Cengage Learning. All rights reserved. No distribution allowed without express authorization.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!