Unix Flashcards

1
Q

What does ls -1 do?

A

That’s a lowercase letter l), which will distinguish between files and directories, and show sizes and dates as well

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

What command would you use to enter or view short text files?

A

cat > new_file.txt Ctrl-D(for EOF) returns you to the command prompt

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

What is a slightly more satisfying text-viewing expderience than cat?

A

less existing_file.txt space bar - move forward a screen b - to move back a screenful q - to quit h- for help

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

How do you use clang to compile your program?

What does it do?

A

clang -Wall my_source.c -o my_program

This will compile my_source. and generate the executable my_program in the current directory

The -Wall option enables all warnings.

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

What does –analyze do?

A

Examines your program, it does not compile.

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

How do you redirect output from your program and redirect it to a text file?

A

./my_program > my_output.txt

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

If you make an infinite loop in Unix, how do you exit it?

A

Ctrl-C to quit

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