2.3 Using Directories and Listing Files Flashcards

1
Q

Directories and Files

display hierarchical listing of directory tree

A

tree

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

Directories and Files

path type

/home/user/Downloads

A

absolute

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

Directories and Files

path type

../Reports

A

relative

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

Directories and Files

path type

/var

A

absolute

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

Directories and Files

path type

docs

A

relative

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

Directories and Files

path type

/

A

absolute

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

Directories and Files

Combining long list with human readable file sizes will give us useful suffixes such as M for
megabytes or K for kilobytes

A

ls -lh

human readable

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

Directories and Files

The -d option will list directories but not their contents. Combining this with */ will show only
subdirectories and no files.

A

ls -d */

directories

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

Directories and Files

Combines long list with the option to sort by modification time. The files with the most recent
changes will be at the top, and files with the oldest changes will be at the bottom. But this order
can be reversed with:

A

ls -lt

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

Directories and Files

Combines long list with sort by (modification) time, combined with -r which reverses the sort.
Now files with the most recent changes are at the bottom of the list. In addition to sorting by
modification time, files can also be sorted by access time or by status time

A

ls -lrt

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

Directories and Files

Combines long list with the option to sort by file eXtension. This will, for example, group all files
ending with .txt together, all files ending with .jpg together, and so on.

A

ls -lx

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

Directories and Files

The -S sorts by file size, much in the same way as -t and -X sort by time and extension
respectively. The largest files will come first, and smallest last. Note that the contents of
subdirectories are not included in the sort

A

ls -S

size

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

Directories and Files

ls -R
The -R option will modify the ls command to display a recursive list. What does this mean?

A

refers to a situation when “something is defined in terms of itself”.

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

Directories and Files

sort by file extension

A

-X(eXtension)

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

Directories and Files

generates a list of all files and directories and indicates size of each

A

du

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

Directories and Files

the -s switch used with the du command

A

display file size of all files , dirs and subdirs

17
Q

Directories and Files

an alias of ls -l in bash

A

ll