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]