Examining the Filesystem Flashcards
In Linux, info and programs are stored on…?
Disks as files.
Files are grouped into…?
Directories, (Which can contain files and other directories, other OS often refer to directories as “folders”)
This hierarchy of directories containing directories is often referred to as …?
The “Directory Tree”
The base of the directory tree is a directory named simply…?
”/” (Referred to as “the root directory”.)
Files within the root directory can referred to as…?
/filename
In Red Hat Linux, root directory contains mostly other directories, such as…?
/etc
Files within these subdirectories may be referred to as…?
/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
Linux provides an easy way to get past a lot of work. Every process, including a user’s shell, uses a…?
Current working directory for context.
Files in a process’s current working directory can be referred to as…?
Simply filename, without the leading slash.
Files in subdirectories of the current working directory can be referred to as…?
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.)
File references relative to root directory always start with a leading /, and are called…?
absolute references.
File references relative to the current working directory start with something other than a /, and are referred to as…?
relative references.
Users use the ls command to …?
list the contents of a directory. (think of the ls as a shortening of the verb “list”.)
ls command, when called without arguments (i.e. without specifying a directory), lists the content of …?
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).
ls command is very flexible command that can provide…?
a lot of different information.
The cat command, when given a list of files, …?
con’cat’entes the files to the terminal output. (if given one file name, the contents of that single file is displayed as output.)
If you ask cat to display a very long file, or a binary (non text) file, cat will…?
happily comply. (There are more sophisticated commands for browsing large flies, a screen full at a time, which will be introduced later.
In Linux, most commands which generate text output use a common Unix concept called the…?
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.)
Using the _____ will redirect standard out into a file.
>
In red hat linux, users are not able to…?
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).
Assuming the shell’s current working directory is /home/elvis, which of the following would to the file /home/elvis/Mail/sent…?
Mail/sent
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…?
- /home/elvis/Mail/received
- Mail/received
What command would list the files in the /usr/lib directory…?
ls /usr/lib
What command would successfully redirect the output of the cal to the file lsout.txt…?
cal > lsout.txt
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
ls /etc > /home/elvis/lsetc.txt