Unix Flashcards
What does ls -1 do?
That’s a lowercase letter l), which will distinguish between files and directories, and show sizes and dates as well
What command would you use to enter or view short text files?
cat > new_file.txt Ctrl-D(for EOF) returns you to the command prompt
What is a slightly more satisfying text-viewing expderience than cat?
less existing_file.txt space bar - move forward a screen b - to move back a screenful q - to quit h- for help
How do you use clang to compile your program?
What does it do?
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.
What does –analyze do?
Examines your program, it does not compile.
How do you redirect output from your program and redirect it to a text file?
./my_program > my_output.txt
If you make an infinite loop in Unix, how do you exit it?
Ctrl-C to quit