Examining the Filesystem Flashcards

1
Q

In Linux, info and programs are stored on…?

A

Disks as files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Files are grouped into…?

A

Directories, (Which can contain files and other directories, other OS often refer to directories as “folders”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This hierarchy of directories containing directories is often referred to as …?

A

The “Directory Tree”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The base of the directory tree is a directory named simply…?

A

”/” (Referred to as “the root directory”.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Files within the root directory can referred to as…?

A

/filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In Red Hat Linux, root directory contains mostly other directories, such as…?

A

/etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Files within these subdirectories may be referred to as…?

A

/etc/filename ( and the process continues for each new level of subdirectories. For example, the file network found in the directory sysconfig, which is in turn found in the directory etc, which is in the root directory /, can be referred to as /etc/sysconfig/network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Linux provides an easy way to get past a lot of work. Every process, including a user’s shell, uses a…?

A

Current working directory for context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Files in a process’s current working directory can be referred to as…?

A

Simply filename, without the leading slash.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Files in subdirectories of the current working directory can be referred to as…?

A

dirname/filename, again without the leading slash. (For example, if a process’s current working directory were /etc, the network file referred to above could be referred to as sysconfig/network. If the working directory was /etc/sysconfig then the file could simply be referred to as network.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

File references relative to root directory always start with a leading /, and are called…?

A

absolute references.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

File references relative to the current working directory start with something other than a /, and are referred to as…?

A

relative references.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Users use the ls command to …?

A

list the contents of a directory. (think of the ls as a shortening of the verb “list”.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ls command, when called without arguments (i.e. without specifying a directory), lists the content of …?

A

the shell’s current working directory. (if using a colour terminal, the ls command also colourizes the filenames to help distinguish which of the directory contents are regular files (white), and which are directories (blue).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

ls command is very flexible command that can provide…?

A

a lot of different information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The cat command, when given a list of files, …?

A

con’cat’entes the files to the terminal output. (if given one file name, the contents of that single file is displayed as output.)

17
Q

If you ask cat to display a very long file, or a binary (non text) file, cat will…?

A

happily comply. (There are more sophisticated commands for browsing large flies, a screen full at a time, which will be introduced later.

18
Q

In Linux, most commands which generate text output use a common Unix concept called the…?

A

Standard out Stream. (By default, this stream is connected to the terminal. The bash shell allows users to “redirect” the standard out stream to other locations.)

19
Q

Using the _____ will redirect standard out into a file.

A

>

20
Q

In red hat linux, users are not able to…?

A

create files just anywhere. (In fact there are only a few places where files can be created. Every user has a home directory, where they can create new files (and new subdirectories). Fortunately, when user’s log in to a Linux session, their shell uses their home directory as its current working directory. By default in Red Hat Enterprise Linux, a users home directory is named /home/username, where username is replaced with the user’s username).

21
Q

Assuming the shell’s current working directory is /home/elvis, which of the following would to the file /home/elvis/Mail/sent…?

A

Mail/sent

22
Q

As the user elvis, whose shell’s current working directory is /home/elvis, which of the following would refer to the file received, which is in the directory Mail, which is in the home directory…?

A
  • /home/elvis/Mail/received

- Mail/received

23
Q

What command would list the files in the /usr/lib directory…?

A

ls /usr/lib

24
Q

What command would successfully redirect the output of the cal to the file lsout.txt…?

A

cal > lsout.txt

25
Q

For the user elvis, with /home/elvis for a home directory, which of the following commands would succeed on a default Red Hat Enterprise Linux installation…?

  • ls /etc > /etc/lsetc.txt
  • /etc/lsetc.txt /home/elvis/lsetc.txt
  • /home/elvis/lestc.txt
A

ls /etc > /home/elvis/lsetc.txt