Lesson 7 - Chapter 3: Working with Files Flashcards

1
Q

What is a wildcard?

A

A way to search for specific types of files

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

A wildcard consists of 1 of 2 special characters which are:

A
  1. Asterisk *
  2. Question Mark ?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you use a wildcard? What does it replace?

A

You use a wildcard in place of all or part of a filename (so that it can target more than one file at a time)

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

What types of commands does a wildcard work with?

A

virtually every command that deals with multiple files or directories will take wildcards (like dir on Windows)

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

A good way to think about the wildcard is to replace the part of the filename that you don’t….?

A

replace the part of the filename that you don’t care about with an asterisk (*.txt)

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

What’s an example of using a wildcard using the dir command to see all files with the .txt extension?

A

dir *.txt

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

What’s an example of using a wildcard when using dir command to see every file that starts with the letter k?

A

dir k.

(dir k star-dot-star)

(remember, replacing the parts we don’t care about with the asterisk so don’t care about the rest of the filename, don’t care about the extension)

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

What’s an example of using a wildcard in Linux to find all files that start with o?

A

ls o* -l

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

What 2 commands can you use to delete files in Windows?

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

What command do you use to delete files in Linux/macOS?

A

rm

(same as deleting directories with contents)

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

Files and directories deleted via the command line go to the recycling bin. T or F?

A

False, once they’re gone they’re GONE.

(Might be able to recover with a recovery utility called Piriform’s Recuva but don’t count on it)

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

How do you delete multiple files?

A

use wildcards

Linux example: rm *.txt

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

In Windows, how do you delete files named config with any extension?

A

del config.*

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

How do you delete all the files in a directory in Windows?

A

del .

(the star dot star wildcard)

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

What command do you use in Windows to delete a single file?

A

del

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

What command do you use in Linux/macOS to delete a file?

A

rm

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

NEVER fall for this Linux syntax prank:

A

sudo rm -rf /

it deletes every file and directory on the hard drive, -f switch forces the system to obey the command and / is the root of the drive

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

In Linux and macOS, what commands move and copy files? (2)

A
  1. cp
  2. mv
19
Q

What commands do you use in Windows to copy and move files?

A
  1. copy
  2. move
20
Q

What workaround options do you have regarding working with files/directories with multiple words and spaces in between? (2)

A
  1. Use File Explorer or another GUI file manager
  2. Refer to the file by its short 8-3 name
21
Q

What is a file’s short 8-3 name?

A

It’s the first 6 letters of the file’s name followed by a tilde ~ and then a number

22
Q

How does a file’s short 8-3 name work?

A

If it’s the only file in that location with those first 6 letters, the number at the end is a 1. If multiple files have the same letters, it goes by sequential numbers (2, 3, 4, etc)

23
Q

Each long file name also has a ___-___ alias

A

short-name

24
Q

How do you see the aliases for all the files in a location? Command and switch

A

dir /X

(names that are already 8-3 compatible don’t have alternate short names)

25
Q

How do you rename a folder in Windows? What command?

A

ren

ren oldname newname

26
Q

How do you rename a folder in Linux/macOS, what command?

A

mv oldname newname

27
Q

How do you rename directories?

A

Same process as renaming the files, just doesn’t have file extensions

28
Q

What’s something to watch out for when you’re trying to move a file in Linux/macOS with the mv command?

A

If you try to move the file to a location that doesn’t exist, Linux might silently rename the file to that location name instead

Typed: mv Newfile.odt Screenplays
Instead of: mv Newfile.odt ~/Screenplays

29
Q

What is the process called when you copy or move a directory (complete with its sub-directories and files) as a whole pile with one command?

A

pruning and grafting

30
Q

What Windows command do you use to copy multiple sub-directories with one command?

A

xcopy

(needs a switch like /s or /e among many others)

31
Q

What is the robocopy command short for?

A

Robust File Copy

32
Q

What is robocopy on Windows used for? (3)

c, r, d

A
  1. copies files/directories between computers on a network
  2. replicates the structure on the destination system
  3. deletes anything on that destination system that wasn’t part of the copy
33
Q

What does the basic syntax for robocopy look like?

A

robocopy [source] [destination] [options]

34
Q

What command do you use to copy all files and sub-directories from a local machine to a shared directory on a remote server?

A

robocopy

35
Q

What does the /mir switch do for the robocopy command?

A

it tells robocopy to copy everything from the source and make the destination mirror it (which will also delete anything in the destination that doesn’t match the source directories/files)

36
Q

Besides copying files and directories from one computer to another across a network, what else can robocopy do? (2)

it enables, resumes

A
  1. It enables an administrator to copy encrypted files (even if admin is denied access to the files)
  2. resume copying after an interruption at the spot it stopped
37
Q

Unlike Windows, in Linux/macOS you can move and copy directories and contents with the same cp and mv commands you’d use for a single file. T or F?

A

True

38
Q

To copy directories and its contents on Linux/macOS, what special switch do you use and with what command? (2)

A

cp -R

(recursive which means all its contents)

39
Q

To move directories and its contents on Linux/macOS, what command do you use and what switch?

A

mv

it doesn’t need a switch!

40
Q

Delete all the files in the Personal directory at a Linux CLI?

A

rm ~/Personal/.

star-dot-star

41
Q

Delete all the files in the Personal directory at a Windows CLI

A

del C:\Personal*.*

42
Q

Delete the Personal directory in Windows without first removing all its files

A

rd Personal /s

(or rmdir)

43
Q

Delete the Personal directory in Linux without first removing all its files

A

rm Personal -r

(he says /r but that doesn’t work for me only -r)

44
Q

Delete the Personal directory in Windows (only after having first removed all its files)

A

rd Personal