- Write the format string you would give to
chmodto give a FILE the following permissions.
Give the owner read, write and execute permissions.
Give the group read and execute permissions.
Give read permissions to anyone else.
I just want the format string NOT the whole command.754- Write a command to sort the file memo.txt and print only the first 10 lines.
sort memo.txt | head- By default, where does Standard Output go?
to the screen- What does the PATH shell variable contain?
the list of directories the shell must search to find the file to run a command- Look at the diagram at the back of this exam.
Assume that you are in the directory home.
Write the RELATIVE pathname you would use to reference the directory it116 under the directory work.
I do not want a command, just the pathname.ghoffman/work/it116- Let's say your there is a directory named work in your current directory. Write a command to remove all the files in the work directory.
rm work/*- If you have a copy of the executable script bother.sh in your current directory, what would you type at the command line to run this script in the background?
./bother.sh &- What is special about a GLOBAL variable?
you can use it in any subshell of the shell in which it was created.- Write a command that will find all the lines containing "hard" in the file memo.txt but NOT the word "red".
grep hard memo.txt | grep -v red- When does a
whileloop stop running?when the command followingwhilereturns an exit status that is not 0- What does the
breakcommand in a loop do?jumps completely out of the loop- Write the command you would use to create the files foo1.txt to foo5.txt using brace expansion and the
touchcommand.touch foo{1,2,3,4,5}.txt- What is the name of the library of procedures that allows you to edit the command line?
the Readline library- Look at the diagram at the back of this exam.
Assume that you are in the directory jimbo.
Write the ABSOLUTE pathname you would use to reference the directory tmp inside the directory ghoffman.
I do not want a command, just the pathname./home/ghoffman/tmp- What command would you use to see all currently running jobs?
jobs- What is a built-in?
a command whose code is part of the shell and does not exist as an executable file on disc- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list all files whose name starts with "bar" followed by one character and ".txt" in this directory?
I do not want the full command, just the argument to that command.bar?.txt- Can an alias be made global?
no- Write the command you would use to test whether the value of the variable number was equal to 0.
test $number -eq 0 or [ $number -eq 0 ]- Name the three types of access permissions.
read, write and execute- Name the three things that can be completed at the command line by hitting Tab.
pathnames, commands, shell variables- By default, where does Standard Input come from?
the keyboard- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list all files with a .txt extension in this directory?
I do not want the full command, just the argument to that command.*.txt- What is a process?
a running program- By default, which account is the owner of a file or directory?
the account that created it- What parameter gives the total number of arguments passed to a script from the command line?
#- Look at the diagram at the back of this exam.
Assume that you are in the directory s22 inside it117.
Write the RELATIVE pathname you would use to reference the root directory.
I do not want a command, just the pathname.../../..- What is the value of the exit status returned by
testto indicate that the expression is true?0- Write the format string you would give to
chmodto give a DIRECTORY the following permissions.
Give the owner all permissions.
Give the group permission to see and change the contents of the directory.
Give everyone else the permissions tocdinto that directory .761- What does a program do just before it stops running?
it sends an exit status to the shell- If a command is running in the background, can it take input from the keyboard?
no- Assume that you are in a directory that contains the files listed at the bottom of the diagram at the back of this exam.
What ARGUMENT USING META-CHARACTERS would you give tolsto list the files whose name starts with "foo" followed by the digits 2 through 5, followed by ".txt"?
I do not want the full command, just the argument to that command.foo[2-5].txt- Look at the diagram at the back of this exam.
Assume that you are in the directory home.
Write the RELATIVE pathname you would use to reference the directory it244 under the directory courses.
I do not want a command, just the pathname.../courses/it244