UNIX 109
B. 755
. The Octal number to be given alogn with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is: A. 000 B. 755 C. 744 D. 555 E. None of the above
a
. Which command sends the word count of the file infile to the newfile. A. wc infile >newfile B. wc <infile >newfile C. wc infile - newfile D. wc infile | newfile E. None of the above
write
BLANK permissions on a file allow you to change the contents of the file.
single
BLANK quotes are used to suppress all character interpretation
chmod
Command to change file permissions ?
pwd
Command to know the directory where you are in currently ? .
4kb * 4096 = 16,000,000 bytes. (16MB)
Consider the FAT12 file system where the cluster size is 4 kilobytes. What is the maximum size hard disk that can be handled?
fee is an argument, fi command, foe argument, fum variable, flip part of an argument, flop variable.
Consider the following command: $ yay fee `fi foe` | $fum "flip > '$flop'" For each of the seven words, identify if they are a: Argument, Command, File, Part of an Argument, or Variable.
The command could be mispelled or the command is not located in one of the directories listed in the PATH variable.
Consider the following command: $floop -bash: floop: command not found An error was generated. Identify two possible reasons why this error occurred.
There are four options: -3, -c, -a, -t (Note that -cat is the same as -c -a -t)
Consider: foo -3 - cat my resume and your_file How many options are in this line?
. There are six arguments: -3, -cat, my, resume, and, your_file
Consider: foo -3 -cat my resume and your_file How many arguments are in this line?
1 (foo)
Consider: foo -3 -cat my resume and your_file How many commands are in this line?
cp myList /
Copy a file called myList in the current directory to the root directory.
ls -a -l
Display a listing of ALL files in the current directory, including each files permissions.
man grep
Display information on how to use the grep command.
man ls
Display information on how to use the ls command.
PATH
Each user has a list of directories that are searched by the system for command files when the user runs a command. the list of directories is stored in what variable?
File System.
FAT32 is a type of BLANK.
$HOME
Give an example of a shell variable
echo $fee
How do you display the contents of a variable called fee?
cd ..
How do you navigate exactly one level up in a folder directory?
How many ways can you change the file permissions of the file fee to rwxr-xr--. list them, and explain the difference.
How many ways can you change the file permissions of the file fee to rwxr-xr--. list them, and explain the difference.
/fee/
If you are currently in the /fee/fi/foe directory, what directory would you be in if you issued the cd ../.. command?
You would still be in /foe/, as simply typing cd foe will not work as that directory does not exist inside of /foe/. If there was another directory called foe inside of foe, you would then be in /fee/fi/foe/foe
If you are currently in the /fee/fi/foe directory, what directory would you be in if you issued the cd foe command?
/fee/fi/foe
If you are currently in the /fee/fi/foe directory, what directory would you be in if you issued the mkdir ../flap command?
Assuming there was a directory inside of fi called fum, and fum had a directory called flip, you would be in: /fee/fi/fum/flip
If you are currently in the /fee/fi/foe/directory, what directory would you be in if you issued the cd ../fum/flip command?
The command stty -echo will make sure that your key strokes, are not displayed to the screen (even though they are being registered). The command stty echo will return your terminal to a state so that your keystrokes are displayed to the screen.
If you need to hide all characters (eg. Trying to keep your commands hidden), how would you enable that?
Ctrl+X, Ctrl+C
In the emacs editor, what command do you use to exit?
c
In vi editor, forward search is performed using the command. A. :pat B. ?pat C. /pat D. All of the above E. None of the above
chmod u+x,g-w foo
Make the file foo executatble for the files owner, and not writeable for the files group. All other permissions should remain unchanged.
File System.
NTFS is a type of BLANK.
/sbin /usr/sbin
On a typical UNIX system, what two directories typically store UNIX commands that can only be executed by the system administrator?
User, Group, Others.
Permissions can be granted to different group classifications. What are they?
PWD
The BLANK command will give you the full pathname of the current directory.
c
The agency that sits between the user and the UNIX system is called the A. logic B. profile C. shell D. erxc E. None of the above
10101
The binary number that comes immediately before 10110 is
D
The cp command uses: A. standard input file B. standard output file C. both input and output file D. neither standard input nor standard output file E. None of the above
33
The decimal number that corresponds to 100001 in binary number system is
256
The set of all 8 bit patterns can be used to represent at most BLANK bits.
$
The two characters that the shell interprets inside double quotes are a back quote, and BLANK
chmod 754 fee
Using octal numbers to specify permissions, provide a command that would change the file permissions on the file fee to rwxr-xr--
ls -l
What UNIX command can be used to see which user is the owner of the file?
which
What UNIX command is used to tell you the location of a command file?
mkdir name
What command do you use to create a director?
tar .cvf foobarBackup.tar foobar
What command would you use to archive the foobar subdirectory, including all of its contents, into a single file called foobarBackup.tar?
cp foo /home/bob
What command would you use to copy file foo to the /home/bob directory?
mv foo /
What command would you use to move file foo to the root directory?
mv foo ..
What command would you use to move the file foo to the parent directory of the current directory?
Changed directory to home
What does cd ~ do?
echo $$ outputs the PID (process identification number) of the current shell process.
What does echo $$ display?
Variable
What is $?
The ">" is the secondary prompt. It will appear at times when the command line requires another line to complete the command specification.
What is the secondary prompt? When would it appear?
User = Read, Execute Group = None Other: Execute
What permissions would chmod 501 grant?
Nothing would display. The value of the variable boss would be assigned to the value "Jon Snow".
What would this command do? boss="Jon Snow"
The file whose name matches the value of the banana variable would be displayed to the screen.
What would this command do? cat $banana
Nothing would display. The contents of file jon and file snow would be catted to the file stark.
What would this command do? cat jon snow > stark
The value of the boss variable would display followed by the word boss
What would this command do? echo $boss boss
Nothign would display. the output door of the ls command would be connected to the input door of the wc command. Since the wc command is being supplied with a file name it will operate on the file dtargary rather than its input door. The wc command outputs a line, word and character count of the file, which is redirected to the file stuff.
What would this command do? ls | wc dtargary > stuff
Nothing would display. A symbolic link called Lannister would be created that is linked to the existing file tyrion.
What would this command do?ln -s tyrion Lannister
echo Hello Dolly - In this case the output presents Hello and Dolly separated by one space. echo "Hello Dolly" - In this case the output presents Hello and Dolly separated by three spaces.
What's the difference between echo hello dolly, and echo "hello dolly"?
type
Which DOS command is used to list the contents of a file?
ls
Which UNIX command is used to list the contents of the current directory?
cat
Which command is used to display and create files?
c
Which command is used to display the characteristics of a process? A. pid B. du C. ps D. au E. None of the above
rmdir
Which command is used to remove a directory?
b
Which command is used to remove a file? A. remove B. rm C. mv D. del E. None of the above
d
Which command is used to remove the read permission of the file 'note' from both the group and others? A. chmod go+r note B. chmod go+rw note C. chmod go-x note D. chmod go-r note E. None of the above
ps
Which command is used to see running processes ? .
wc
Which command tells you how many lines, words, and characters there are in a file ? .
d
Which command will be used with vi editor to insert text to left of cursor? A. s B. S C. a D. i E. None of the above
| (pipe)
Which of the following characters is used to redirect input to a command from another command?
A. ls -l -d
Which of the following commands is used to display the directory attributes rather than its contents? A. ls -l -d B. ls -l C. ls -x D. ls -F E. None of the above
a
Which of the following commands is used to list contents of directories? A. ls B. lp C. dir D. tar E. None of the above
c
Which of the following directories contain all the Alias created by a user, including his login directory? A. /tmp B. /etc C. /usr D. /dev E. None of the above
cp foo bar
what is the command to copy file foo to the bar subdirectory?