03 Exploring The System Flashcards
What command does ‘ls’ invoke?
Lists the contents of the current or specified directory.
Describe the output of the command “ls -l”:
Provides the “long listing” (the details) of the current or specified directory.
The command ‘ls -l’ was performed and generate the following output. Describe the output:
Total 56
Drwxrwxr-x 2 me wheel 4096 2018-08-07 17:05 myfile.txt
Drwxrwxr-x : File permissions 2: Number of hard links to file Me: owner Wheel: owner group 4096: File size 2018…: last modified time Myfile.txt: file name
“Commands are often followed by one or more [blank] that modify their behavior, & further by one or more [blank].
Options / arguments
“Commands are often followed by one or more options that modify their behavior, & further by one or more arguments.”
What is meant by ‘arguments’ in the above statement?
‘Arguments’ refers to the items on which the command option(s) act.
Describe the options and long options for the following description of the ‘ls’ command.
“Lists all files, even those that begin with a period, which are normally hidden.”
-a / - - all
Describe the options and long options for the following description of the ‘ls’ command.
“Output is like ‘-a’, although ‘.’ & ‘..’ are hidden.”
-A / - -almost-all
Describe the options and long options for the following description of the ‘ls’ command.
“Normally, if a directory is specified, ls will list the contents of the directory. Supplying this argument will list details about the directory instead.”
-d / - -directory
Describe the options and long options for the following description of the ‘ls’ command.
“Append an indicative character to the end of output, for example, a ‘/‘ at the end of directories.”
-F / - -classify
Describe the options and long options for the following description of the ‘ls’ command.
“Displays file size in a human-readable format as opposed to bytes.”
-h / - -human-readable
Describe the options and long options for the following description of the ‘ls’ command.
“Displays results in long format.”
-l / [no long option]
Describe the options and long options for the following description of the ‘ls’ command.
“Displays results in reverse order.”
-r / - -reverse
Describe the options and long options for the following description of the ‘ls’ command.
“Sort files by file size.”
-S / [no long options]
Describe the options and long options for the following description of the ‘ls’ command.
“Sort output by modification time.”
-t / [no long options]
Which command would you use to determine the type of a given file?
file
True or False: filenames in Linux are required to describe the file type, eg: ‘foobar.pdf’
False. Extensions are not required, and if present, do not have to indicate the file type.
True or false: In Linux, “Everything is a file”.
True
What is the purpose of the program ‘less’?
It is a “pager” used to view text files.
With regard to the ‘less’ program, how do you…
Go back one page?
[Page up] or b
With regard to the ‘less’ program, how do you…
Go forward one page?
[Page down] or [space]
With regard to the ‘less’ program, how do you…
Scroll up one line?
[up arrow]
With regard to the ‘less’ program, how do you…
Scroll down one line?
[down arrow]
With regard to the ‘less’ program, how do you…
Move to the end of the file?
G
With regard to the ‘less’ program, how do you…
Move to the beginning of the file?
1G or g
With regard to the ‘less’ program, how do you…
Search the file for the next occurrence of characters?
/characters
With regard to the ‘less’ program, how do you…
Search for the next occurrence of the previous search?
n
With regard to the ‘less’ program, how do you…
Display the help screen?
h
With regard to the ‘less’ program, how do you…
Quit ‘less’?
q
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/
The root directory.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/bin
Binaries that must be present for the system to boot. Fundamental utilities such as ‘ls’ and ‘cp’.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/boot
Contains the kernel, boot loader, and initial RAM disk image (drivers needed at boot time)
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/dev
Contains “device nodes”, a list of devices that the kernel understands.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/etc
Contains system-wide configuration files & shell scripts that start system services.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/home
Contains user home directories.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/lib
Contains essential shared libraries used by core system programs.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/lost+found
Used in cases of partial filesystem corruptions.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/media
On modern Linux systems, mount points for removable media devices that are mounted automatically.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/mnt
On older Linux systems, used as a temporary mount point.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/opt
Contains locally installed software, one sub directory per package.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/proc
A virtual filesystem maintained by the kernel that describes how the kernel “sees” the computer.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/root
The home directory for the root user.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/shin
Stands for “system (or super user) binaries” and contains fundamental utilities, usually needed to start, maintain, or recover the system.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/tmp
Contains temporary, transient files not expected to survive a reboot.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr
Contains programs and support files used by regular system users.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/bin
Contains all programs installed by the distribution.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/lib
Contains shared libraries used by programs in /usr/bin
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/local
Location where programs not installed by the distribution (but intended for system-wide use) are installed.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/local/bin
Contains programs that are compiled from source code.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/bin
Additional system administration programs
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/share
Contains all shared data used by programs in /usr/bin, such as backgrounds, icons, sound files, etc.
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/usr/share/doc
Documentation files organized by package
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/var
Location where data that is likely to change is stored, for example, databases, spool files, user mail
Define the given directory as described by the Linux Filesystem Hierarchy Standard:
/var/log
Contains system log files