Ch.4 Manipulating Files and Directories Flashcards

1
Q

what does command cp do?

A

Copy files and directories

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

what does command mv do

A

move/rename files and directories

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

what does mkdir do

A

create directories

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

what does rm do

A

remove files and directories

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

what does ln do

A

create hard and symbolic links

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

What do Wildcards allow us to do?

A

Select filenames based on patters of characters. Also called globbing.

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

What are the five wild cards?

A
      1. ? 3. [characters] 4. [!characters] 5. [[:class]]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Wildcard that matches any characters

A

*

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

Wildcard that matches any single character?

A

?

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

Wildcard that matches any character that is a member of the set characters?

A

[characters]

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

Wildcard that matches any character that is not a member of the set characters.

A

[!characters]

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

Wildcards that matches any character that is a member of the specified class

A

[[:class]]

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

What are the five most commonly used character classes?

A
  1. [:alnum:] 2. [:alpha;] 3. [:digit:] 4. [:lower:] 5. [:upper:]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Character class that matches any alphanumeric character

A

[:alnum:]

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

Character class that matches any alphabetic character

A

[:alpha:]

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

Character class that matches any numeral

A

[:digit:]

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

Character class that matches any lowercase letter

A

[:lower:]

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

Character class that matches any uppercase letter

A

[:upper:}

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

Wildcard that matches all files

A

*

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

Wildcard that matches any file beginning with “g”

A

g*

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

Wildcard that matches any filebegnning with “b” followed by any characters and ending with “.txt”

A

b*.txt

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

Wildcard that matches any file beginning with “Data” followed by exactly three characters

A

Data???

23
Q

Wildcards that matches any file beginning with either an “a”, a “b”, or a “c”

A

[abc]*

24
Q

Wildcard that matches any file beginning with “BACKUP” followed by exactly three numberals

A

BACKUP. [0-9][0-9][0-9]

25
Q

Wildcard that matches any file beginning with an uppercase letter

A

[[:upper:]]*

26
Q

Wildcard that matches any file not beginning with a numeral

A

[![:digit:]]*

27
Q

Wildcard that matches any file ending with a lowercase letter or the numerals 1,2, or 3.

A

*[[:lower;]123]

28
Q

What does it mean when three periods follow an argument in the description of a command?

A

the argument can be repeated. i.e mkdir needs 1 command to run, but can have multiple. cd needs 0-1 commands to run but cannot do more.

29
Q

How do you copy the single file item1 to the single file item2?

A

cp item1 item2

30
Q

How do you copy multiple items into a directory?

A

cp item…directory

31
Q

cp option that copy the files and directories and all of their attributes, including ownerships and permissions. Normally, copies take on the default attributes of the user performing the copy.

A

-a, –archive

32
Q

cp option that before overwriting an existing file, prompts the user for confirmation

A

-i, –interactive

33
Q

cp option that recursively copies directories and their contents.

A

-r, –recursive

34
Q

cp option that when copying files from one directory to another, only copies files that either don’t exist or are newer than the existing corresponding files, in the destination directory. This is useful when copying large numbers of files as it skips files that don’t need to be copied.

A

-u, –update

35
Q

cp option that displays informative messages as the copy is performed

A

-v, –verbose

36
Q

cp command that copies file1 and file2 into directory dir1

A

cp file1 file2 dir1

37
Q

cp command that using a wildcard, copy all the files in dir1 into dir2.

A

cp dir1/* dir2

38
Q

cp command that copy the contents of directory dir1, to directory dir2. If directory dir2 does not exist, it is created and, after the copy, will contain the same contents as directory dir1.

A

cp -r dir1 dir2

39
Q

command to more or rename the file or directory item1 to item2

A

mv item1 item2

40
Q

command to move one or more items from one directory to another

A

mv item… directory

41
Q

mv option that before overwriting an existing file, prompts the user for confirmation. if this option is not specified, mv will silently overwrite files.

A

-i, –interactive

42
Q

mv option that when moving files from one directory to another, only move files that either don’t exist or are newer than the existing corresponding files in the destination directory.

A

-u, –update

43
Q

mv option that display informative messages as the move is performed

A

-v, –verbose

44
Q

rm option that before deleting an existing file, prompts the user for confirmation

A

-i, –interactive

45
Q

rm option that recursively deletes directories. This means that if a directory being deleted has subdirectories, it deletes them too. To delete a directory, this option must be specified.

A

-r, –recursive

46
Q

rm option that ignores nonexistant files and do not prompt

A

-f, –force

47
Q

rm option that display informative messages as the deletion is performed

A

-v, –verbose

48
Q

The following creates a hard link

A

ln file link

49
Q

the following creates a symbolic link

A

ln -s item link

50
Q

What are the two things are hard link cannot do?

A
  1. reference a file outside its own file system. This means a link cannot reference a file that is not on the same disk partition as the link itself. 2. A hard link may not reference a directory
51
Q

Which type of link is indistinguishable from the file itself?

A

The hard link

52
Q

How do symbolic links work?

A

They create a special type of file that contains a text pointer to the referenced file or directory.

53
Q

What happens when you delete a file and not it’s symbolic link?

A

The link points to nothing and is described as broken