Lesson 7 - Chapter 2: Mastering Fundamental Commands Flashcards
What command in Windows and macOS/Linux show you the contents of the working directory? (2)
- Windows = dir
- macOS/Linux = ls
(DIRectory, Let’s See)
What does the “dir” command do? For what OS? (2)
- dir = shows the contents of the working directory
- for Windows
What does the “ls” command do? For what OS? (2)
- ls = shows the contents of the working directory
- For macOS and Linux
What does the command and syntax look like when trying to view another directory’s contents (Documents) from the root directory in Windows?
C:>dir C:\Users\vanes\Documents
(we include the desired location as an argument)
The default prompts in ____ don’t show the full path
Linux
scott@server:~$ ls
Desktop Downloads Public Videos
Documents photo.jpg timmy.doc
When you enter “dir” and a lot of text scrolls quickly down the screen, how can you pause it? (command)
type
dir /p
(notice that it’s a forward slash for Windows in this instance)
When you use dir /p to pause, how do you display the next screen?
spacebar
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)
dir /w
(wide list format)
What short-form switch in Windows lets you see all the possible switches for the “dir” command?
dir /?
How do you use the switches /p and /w for the dir command simultaneously?
dir /w /p
What’s one of the most important switches that the ls command uses out of its more than 50 different switches? (Linux)
-l
What does the -l switch stand for?
long listing (gives detailed information about the files)
In what OS does the pipe command work in?
All 3
It’s incredibly powerful
When would you use the pipe command?
when telling the OS to take the output of one command and pipe it through a second command
What’s the Linux/macOS equivalent of Window’s dir /p?
ls | more
What’s the main help switch and command to learn for Windows? (2)
- /?
- help (by itself to show what commands you can use)
What’s the main help commands to learn for Linux? (2)
- help (by itself to show what commands you can use)
- man (followed by a command to view syntax documentation)
The “cd” command works in which OS?
All 3
To change to a directory that is beneath the current one in the hierarchy, you don’t have to do what?
specify the full path to it just its name (shorthand)
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)
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)
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 \ in front (of Windows in this example)
backslash
C:\Users>cd \Windows\System32