Lesson 7 - Chapter 2: Mastering Fundamental Commands Flashcards

1
Q

What command in Windows and macOS/Linux show you the contents of the working directory? (2)

A
  1. Windows = dir
  2. macOS/Linux = ls

(DIRectory, Let’s See)

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

What does the “dir” command do? For what OS? (2)

A
  1. dir = shows the contents of the working directory
  2. for Windows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the “ls” command do? For what OS? (2)

A
  1. ls = shows the contents of the working directory
  2. For macOS and Linux
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the command and syntax look like when trying to view another directory’s contents (Documents) from the root directory in Windows?

A

C:>dir C:\Users\vanes\Documents

(we include the desired location as an argument)

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

The default prompts in ____ don’t show the full path

A

Linux

scott@server:~$ ls
Desktop Downloads Public Videos
Documents photo.jpg timmy.doc

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

When you enter “dir” and a lot of text scrolls quickly down the screen, how can you pause it? (command)

A

type
dir /p

(notice that it’s a forward slash for Windows in this instance)

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

When you use dir /p to pause, how do you display the next screen?

A

spacebar

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

What command and short-form switch do you use when there are a lot of files and you don’t care about the details you just want to see the filenames arranged in 5 columns? (Windows)

(wide list format)

A

dir /w

(wide list format)

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

What short-form switch in Windows lets you see all the possible switches for the “dir” command?

A

dir /?

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

How do you use the switches /p and /w for the dir command simultaneously?

A

dir /w /p

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

What’s one of the most important switches that the ls command uses out of its more than 50 different switches? (Linux)

A

-l

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

What does the -l switch stand for?

A

long listing (gives detailed information about the files)

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

In what OS does the pipe command work in?

A

All 3

It’s incredibly powerful

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

When would you use the pipe command?

A

when telling the OS to take the output of one command and pipe it through a second command

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

What’s the Linux/macOS equivalent of Window’s dir /p?

A

ls | more

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

What’s the main help switch and command to learn for Windows? (2)

A
  1. /?
  2. help (by itself to show what commands you can use)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What’s the main help commands to learn for Linux? (2)

A
  1. help (by itself to show what commands you can use)
  2. man (followed by a command to view syntax documentation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The “cd” command works in which OS?

A

All 3

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

To change to a directory that is beneath the current one in the hierarchy, you don’t have to do what?

A

specify the full path to it just its name (shorthand)

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

Since you can move more than one level of hierarchy at a time that’s below in hierarchy, how do you go from a C: root directory to C:\Obiwan\my\hope? (Type out prompt)

A

C:>cd obiwan\my\hope

(notice there is NO backslash in front of obiwan, if going in deeper in the current subdirectory don’t need a backslash in front)

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

In order to change to a directory that’s NOT below the current working directory, what do you include before the name?

Example:
C:\Users current working directory
Change to:
C:\Windows\System32

A

a \ in front (of Windows in this example)

backslash

C:\Users>cd \Windows\System32

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

How do you return to the root directory?

A

type cd \

23
Q

How do you return to the root directory in Linux or macOS?

A

cd ~

24
Q

In Linux/macOS and Windows, what types of slashes do they use? (2)

A
  1. Linux/macOS forward slash
  2. Windows backslash
25
Q

On a Linux system, what directory should you not create files and directories in?

A

the root / directory

(so a user can’t break the OS)

26
Q

Do you use the cd command to move between drives on Windows?

A

No

27
Q

How do you move between Windows’ drive letters?

A

you type the drive letter and a colon

from C:\
to E:
it would look like C:>E:

to go back you just do the same and it returns you to the same directory you left

28
Q

All media in macOS and Linux is mounted as…?

A

directories

29
Q

In macOS, where is media mounted to?

A

/Volumes directory

30
Q

In Linux Ubuntu, where are drives mounted to and where is removable media mounted to? (2)

A
  1. Drives = /mnt directory
  2. Removable Media = /media/username
31
Q

What command do you use to make a directory in Windows? (2 options)

A
  1. md
  2. mkdir
32
Q

What’s the difference between md and mkdir commands?

A

md has 1 required argument: the name of the directory to create and mkdir works on all 3 OS

33
Q

How do you create multiple directory layers at once to make a files directory and a games directory inside the files directory under Scott? (Windows)

Working directory: C:\Users\scott

A

C:\Users\scott>md files\games

34
Q

What command do you use to make a directory in macOS/Linux?

A

mkdir

(only)

35
Q

What command do you use to remove an empty directory? 3 options. Which OS do they work on?

A
  1. rmdir = all 3 OS
  2. rd or rmdir = Windows
36
Q

Can the rmdir or rd delete a directory that contains files/sub-directories?

A

No, it needs to be an empty directory

37
Q

On Windows, what switch can you use to delete a directory with all its files and sub-directories?

A

rd /s

(remember files deleted from command line don’t go to the recycling bin)

38
Q

What command and switch do you use to delete a directory with all its files and sub-directories in Linux/macOS?

A

rm -r

39
Q

How do you run a program from the command line in Windows? (2 options)

A
  1. Change to the working directory it’s in, type the filename (like mmc), ENTER
  2. Type the complete path to the executable file from the current working directory
40
Q

All files with extensions .exe and .com are…?

A

programs

41
Q

How are macOS/Linux executable programs from the command line different from Windows? (2)

A
  1. Don’t rely on any kind of extension (like .exe)
  2. Any file (code, text file, etc) can be given the property of executable
42
Q

Almost all versions of Linux come with what kind of coded command lines?

A

color-coded

43
Q

What color might executable files be in Linux?

A

green

44
Q

What are the 2 types of executable file types that Linux has?

A
  1. Built-in
  2. Executables
45
Q

What’s the difference between built-in programs and executable programs in Linux? (2)

(2 different types of executable file types in Linux)

A
  1. built-in programs = like built-in commands [mkdir, ls, rm] or built-in programs you type the name in
  2. executable programs = not built-in, unzip program and add ./ to executable name to run it from command line
46
Q

In Linux, can you type the name of the executable program in the command line to run it if you’re in the directory that holds it after unzipping it?

A

No, it needs more syntax to run the executable

47
Q

What happens when you run a program from the Linux command line? What does Linux look through first?

A

A series of directories called the path (not like a command prompt path)

(it won’t run yet without additional syntax)

48
Q

What do you add in front of an executable in Linux to make it run?

A

a dot and a slash ./

scott@server:~/$./runme

49
Q

To create a directory in either Windows or Linux, use the command….?

A

mkdir

50
Q

For a listing of the working directory’s content, use the ___ command in Linux or the ____ command in Windows.

A
  1. ls
  2. dir
51
Q

To remove a directory in either Windows or Linux, use the ___ command.

A

rmdir

52
Q

To change the working directory, use the ____ command in Linux or the ____ command in Windows.

A
  1. cd
  2. cd
53
Q

To remove a directory in Windows without first deleting its content, use the ___ switch. (But be careful!)

A

/s