Homework Quiz Questions Flashcards
Linux is a free operating system developed for the __________
processor that is intended to replicate the functionality of ________
80X86, Unix
Linux was first released by ___________ , who was a student at University of Helsinki at the time.
Linus Torvalds
C was developed at _________ in the early 1970’s simultaneously with
_______.
Bell Labs, Unix
The command ____________ prints the absolute path to your current working directory.
pwd
The ____________ command is used to change permissions on a file.
chmod
________ changes the working directory to the root directory
cd /
________ changes the working directory to the user’s home without using tilde expansion.
cd
______ changes the working directory to the user’s home directory using tilde expansion.
cd ~
______ changes the working directory to the user bob’s home directory using tilde expansion.
cd ~bob
Explain the differences between a static C library and a C shared library
Static libraries are libraries that can be used in multiple programs, inside of a program when it is compiled. Conversely, shared libraries exist completely separate from the compiled program as a separate file or files
Write a command that assigns the value “CSI 3336” to an environment variable named classNumber.
classNumber=”CSI 3336”
Write a command that assigns the value “Systems Programming” to an environment variable named className.
className=”Systems Programming”
Write a command that concatenates the values found in classNumber and className into a new environment variable named class
class=”$classNumber$className”
Write a command that lists the directory contents of the local directory and all subdirectories.
ls -r
Write a command that creates a new directory named cs3336 in the current working directory.
mkdir cs3336
Write a command that displays the current system time.
date
Write a command that changes the permissions of a file named output rwxr-xr— using octal numbers in combination with chmod.
chmod 754 output
Write a command that changes the permissions of a file named output rwxr-xr— using characters (not octal numbers) in combination with chmod (without octal numbers).
chmod u=rwx,g=rx,o=r output
Write a command that displays all exported environment variables
env
Explain what cat does
cat reads the files you provide and writes them out sequentially to stdout. It can be used to quickly examine the contents of a file, or a few small files.
Explain what less does
less is a quicker version of more. It displays the contents of a file in a page-by-page format, but doesn’t load the whole file at once which makes it faster. This makes it a much better option for just viewing files than opening them up in something like vi or vim.
Write a command that displays the first 5 lines of a file named classList.txt.
head -n 5 classList.txt
Write a command that displays the last 10 lines of a file named classList.txt.
tail -n 10 classList.txt
Write a command that changes the status time (this includes access, modify, and change times) of a file named myFile to the current system time.
touch myFile