Intro 4 Flashcards

1
Q

How can you search the man pages by keyword?

A

man -k keyword

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

What flag can you use if you are just searching for a certain option for a command?

A

Try entering the command name followed by –help or -h.

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

What’s an alternative to man pages?

A

info

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

To send the output of a command to a file instead of the terminal, use the ______ character.

A

> redirection

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

When you use the redirection character (>) followed by a filename that does not exist, what happens? What if it does exists?

A

It creates the file. If the file exists, it clobbers (erases) the files content.

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

How can you append the output of a command to a file instead of overwriting it?

A

command&raquo_space; file

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

How can you redirect standard error (stderr)?

A

By redirecting stream id 2, e.g. 2>

You can also send it to the same place as stdout with the >& notation, e.g. ls /fffff > f 2>&1

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

What are the three parts of a UNIX error message?

A

program name
filename
the error

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

What do you expect when you see “segmentation fault”?

A

A segmentation fault essentially means that the person who wrote the progrma that you just ran screwed up somewhere. The program tried to access a part of memory that it was not allowed to touch, and the operating system killed it.

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

What does a bus error mean?

A

The program tried to access some memory in a particular way that it shouldn’t.

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

ps x

A

show all of the running processes

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

ps ax

A

show all processes on the system, not just the ones you own

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

ps u

A

include more detailed information on processes

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

ps w

A

show full command names, not just what fits on one line

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

Using ctrl-c to terminate a process that is running in the current terminal is the same as using ____________ with the _____.

A

kill to end the process

INT (interrupt) signal

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

Shells support ______, which is a way to send TSTP (similar to STOP) and CONT signals to programs by using various keystrokes and commands.

A

job control

17
Q

You can send a TSTp signal with _____, then start the process again by entering ______ or _____.

A

Ctrl-Z
fg (bring to foreground)
bg (move to foreground)

18
Q

To see if you’ve accidentally suspended any process on your current terminal, run the _____ command.

A

jobs

19
Q

Normally, when you run a Unix command from the shell, you don’t get the shell prompt back until the program finishes executing. However, you can detach a process from the shell and put it in the “background” with the _______; this gives you the prompt back.

A

ampersand &