Elance Unix Test Answers 2015



Files in Unix may be a representation of the system's:
Disk drives
Terminals
All are correct
I/O devices


When searching the path, if there are two commands with the same name:
either one that is found in the path will be executed
the one that is found last in the path will be executed
an error will be produced
the one that is found first in the path will be executed


To refer to your home directory, you use:
$LOGDIR
!
All are correct
$HOME


A hidden file is any file whose:
first character of the filename is a '.'
located in the directory /tmp
there are no hidden files in Unix
extension is 'hidden'


Which command is used to send and receive mail in Unix?
outlook
mailman
mailx
apple


The command that lists the users logged on to the system now is:
who
whoison
logged
log


To temporarily change your UID, you use the command:
masq
passwd
su
logout and login


In an inode, you usually will find:
A file reference count: the total number of names the file has
The location of the file's contents on the disk, if any
The time the file's inode was last modified
all are correct


To execute commands and programs in the background you type in the command line, they must be followed by:
&
@
;
|


To give everybody in your group write permission to the file flog, you do:
chmod g+w flog
chmod w+g flog
chmod u=w flog
chmod g-w flog


When you type the name of a command, the shell finds it in:
the search path for an executable program or script with the given name
list of built-in commands
the aliases or shell functions
all are correct


To change the file flog so people who don't belong in your group can't read it, you use the command:
chmod o=r flog
chmod o+r flog
chmod o-r flog
chmod u=r flog


If a file has the permissions "-rwxr-x---", they can be specified as an octal mode of:
570
463
3640
750


To display hidden (dot) files, you use the command:
ls -d
ls -H
ls -a
ls -h


In Unix, which of the following are not treated as files?
Terminals
Disk drives
In Unix, everything is a file
Directories


True or False: File names that begin with a period are called "hidden" files--that is, they are only revealed if you issue a special command.
False
True
A period is not a valid charcter in a file name
A period is not a valid first charcter in a file name


What's the environment variable for your default shell?
$SHELL
!SHELL
$MYSHELL
$DEFAULT_SHELL
%SHELL%


To specify an absolute path, the string for the path starts with:
/
~
any valid character
$HOME


Unix uses the N character to separate the directories in the pathname. N is:
\
@
/
,


What do we get from running this command? echo "april|may|june|july" | awk -F'|' '{print $3}'
error
july
may
april
june


To check the Current Date and Time you use:
dd
time
tr
date


The search path is stored in an environment variable named:
SEARCHPATH
DIRS
PATHS
PATH


The format of a cp command is to specify:
first the name of the file you want to copy and then the new filename
-s before the name of the file you want to copy (source) and -d before the new filename (destination)
first the new filenamen and then the ame of the file you want to copy
-i before the name of the file you want to copy (input) and -o before the new filename (output)


To make a file ac2 executable, you use the command:
exec ac2
mkexec ac2
chgrp +x ac2
chmod +x ac2


When root creates a new account, by default the account password is:
Same as the Unix version and Revision numbers
Same as the hostname
There are no "default" passwords on Unix
Same as the account name


If you accidentally deleted a file FFF with the 'rm FFF' command, you can restore it using:
the copy left in the /.recycle directory
undelete FFF
there's no way to reverse a delete operation on Unix
rm -u FFF


To Rename a file, you use the command:
set
id
mv
ren


The mv command:
none are correct
copies a file to a new location and leaves a copy in the original location
moves a file to a new location
copies a file to a new location and leaves a copy in the original location with the '.org' extension


What happens if you try to create a directory with a name that has already been used?
you get an error message
the directory is emptied (all files in it are deleted)
the old directory will be renamed with '.bak' extension
you'll be entered into a sub shell to fix the problem


To securely copy files between computers, you use:
scs
rcp
rcs
scp


You can change your password with the command:
passchange
passwd
chpass
chpasswd


To become the superuser, you can can use the command:
superuser
chprio
root
su


If you want to verify the pathname of the directory you are currently in, you use the command:
dir
pwd
path
cwd


Unix filenames are case sensitive. This is:
Always true
Always false
True in networked environments only
True in BSD Unix only


To make a secure encrypted connection to the remote computer, you use:
rsh
ssh
rlogin
telnet


If your (effective) process UID is 0, you can:
all are correct
send signals to processes
change contents of memory locations
change the nice value of processes


To create a directory, you use:
None are correct
mkdir
All are correct
dir-mk
md


Unix has the following file/directory permissions:
Read, write, execute
Read, write, modify
Read, write, change
Read, write, delete


You display the contents of a text file on the screen using the command:
type
cat
pr
print


On Unix, you copy a file using the command:
file->copy
All of these
cat
copy
cp


To list directories rather than their contents, in ls you use the flag:
-r
-s
-a
-d


To refer to the parent of the current working directory, you use:
~
..
true in SysV Unix only
.
Ö


Which of the following is NOT a scripting language in Unix?
Tcl
script
Perl
Python


A Unix user can belong to:
more than one group if the user's UID is 0
more than one group
exactly one group
more than one group if the user is root, daemon, agent, uucp, lp, or news


To list only the account name associated with the current login, you use the command:
id
w
who
whoami


Once you delete a file in Unix:
it is moved to a special directory
it is gone forever
it is still in the file-system
it is recoverable easily


After a fork, the new process...
inherits its current directory from its parent process
has what is in the sixth field of the user record in the /etc/passwd file, as its current directory
has the $PWD directory as its current directory
has its user's home directory as its current directory


The Unix escape character is:
|
\
/
!


The Bourne shell has one file in your home directory that it reads when you log in; this file is:
.sh.login
.bourne
.profile
.shrc


If your account is named myuser, and you changed your password, one way to test that you type the new password correctly is:
user myuser
su myuser
verify myuser
None of these


Which command is used to make a compressed archive of a directory?
All of these
tar cvf <directory.tar> <directory>
tar create <directory.tar> <directory>
tar xvf <directory.tar> <directory>


When files are recovered after any sort of problem or failure, if the kernel cannot ascertain the proper location in the file system, the recovered file is placed in the directory:
recovered
crash
lost+found
tmp


If you use the command 'ls -F', a string that ends in @ is a:
symbolic link
directory
program (executable) file
normal, plain file


The cal command...
shows a scientific calculator
none are correct
shows a simple calendar
shows a simple calculator


If you wanted to have multiple outputs for a particular command or script which standard base utility would you use?
tee
mir
mirror
tea
rep


In the /etc/group file, the group with GID 0 contains:
all users with non privileged accounts
all the system's administrators (root users)
all the privileged accounts of the system (e.g., daemon or lp)
all the users on the system


The Unix end-of-file character is:
Control-D
Control-J
Control-M
Control-R


You instruct a program to take its input from a previously prepared text file using the input redirection character:
<<< 
<< 
;


To channel the output of one command or program into the input of another, you use:
&
|
>> 


The numeric permission equivalent to '-rw-rw----' is:
770
440
330
660


The notation '.' in an ls listing, is shorthand for:
a regular file
a hidden file
the current location in the directory hierarchy
the parent directory (one level up) in the directory hierarchy


The command 'chmod -x /tmp/tmp.tmp' will:
sort alphabetically by entry extension the file tmp.tmp in /tmp
remove execution permission from the file tmp.tmp in /tmp
load the module contained in the file tmp.tmp in /tmp, and execute it
add execution permission from the file tmp.tmp in /tmp


A good account name for the default user that will need to carry out only non-privileged operations is:
nobody
daemon
root
lp


To show the grand total, in kilobytes, of all directories (to which you have access) at or below the current point in the file system, you use:
dd -a
df --total
du -sk
df -t


chmod allows you to specify permissions for a file using octal numbers. 1000 permission is:
Execute by other
Execute by group
Execute by owner
Sticky bit


What will be the output of the command: basename /var/tmp/myfile.txt
/var
/var/tmp
myfile
myfile.txt
.txt


To run network services on "trusted" (numbered below 1024) ports, your effective UID should be:
same as the port number
6
1
0


Can a Unix filename contain a space?
Yes
No


If you wish to change both owner and group of a file in a two-step process, use these commands:
chmod and chowngrp
chown and chomod
chowngrp and chgrp
chgrp and chown


The standard shell of Unix System V is:
bash
sh
tcsh
csh


In Unix, ping works on which protocol?
arp
udp
icmp
tcp


To know which tty you are on, you use the command:
terminal
term
whoami
tty


What does SNMP stand for?
Socket Node Messaging protocol
System Node Message protocol
Simple Network Messaging Protocol
Simple Network Management Protocol


A period, in a Unix file name:
Is just another valid character
Is not allowed
Is not allowed as first character
Separates the file name from the file extension


If you execute the following, which users can read the file? chmod 060 file
Only the file's owner
Only members of the file's group, except for the file's owner.
Only members of the file's group including the file's owner
All users


Passwords may contain:
Any character, and the system distinguishes between upper and lower case characters
Any character, and the system does not distinguish between upper and lower case characters
Only upper and lower case characters, numbers, and the "_" character
Any character besides: "/',.() and the system distinguishes between upper and lower case characters


A password security feature of Unix allows N to set an expiration date on users' passwords:
N is anyone in the user's groups
N is the account owner
N is the superuser
all are correct


Listing directory trees recursively, in ls you use the flag:
-r
-a
-R


The whereis command helps you to locate...
source code
manual pages
executable files
all are correct


Which of the following find commands is correct?
find . -name "taco*" -exec rm {} \;
find . -name "taco*" -exec rm %1 ;
find . -name "taco*" -exec "rm {} ";
find . -name taco* -exec rm {}


What happens to a process accessing a file if you delete the file?
The process continues to access the file via its inode
The process loses the file lock
The process crashes
You can still find the file in /lost+found
The process asks you what new file to save the data in


In a file delimited by commas, what command will print the 3rd column of data:
awk -F, '{print $3}'
awk '{print $3}'
awk -f, '{print $3}'


Which of the following is NOT used as a wild-card in the shell?
?
[mn]
*
^


What will the following command result in on a SystemV host?: ps -ef | grep "[/]sbin/init"
Will display the init process and the grep process
Will display only the init process
Will display every process except for init
Will display only the grep process


The command 'chmod o+w flog' will...
modify the owner's privileges for flog
modify group privileges for flog
modify others' privileges on flog
modify privileges for flog for all users


What is the primary difference between binaries located in /bin and /sbin versus /usr/bin and /usr/sbin?
Binaries located in /usr/bin and /usr/sbin are built exclusively by the system admin or users.
There is no difference other than historical preference.
Binaries located in /bin and /sbin are expected to be on the root partition to be available for single user or repair modes.
Binaries located in the /usr trees have different permission sets.


When you execute the command 'cp . newdir', you...
get an error or the directory is copied as a regular file
copy the current directory files and directories to the newdir directory
copy the current directory files and its directories and contents (recursively) to the newdir directory
copy the current directory files to the newdir directory


The command that would append the output from the encrypter to the current contents of the file private and read in the contents of the file top_secret, is:
encrypter < top_secret >> private
encrypter << top_secret > private
encrypter < top_secret > private
encrypter > top_secret << private


How does Unix maintain its time clock?
epoch format
tz format
all of them are correct
YYYYMMDDHHMMSS format


To be run by the shell, a shell script needs the following permission(s):
read and execute
write and execute
execute
read, write, and execute


To list the current users logged on to the system you use:
who
all are correct
w
users


The superuser can:
none are correct
kill a process that is in a "wait" state in the kernel
decrypt (to ASCII) the passwords in the /etc/passwd file
all are correct


To display or set your terminal characteristics, you use the command:
tty
term
stty
terminal


What is the default maximum number of open files a user can have?
8192
1024
unlimited
4096
2048


In an ls listing, 'l' 's' and '-' indicate:
Local file, Symbolic link, Regular file
Local file, Symbolic link, Directory
Symbolic link, Socket, Regular file
Symbolic link, Socket, Directory


If you use the command sequence: echo "hello">file; ln file newfile; rm file; What will happen when you run: cat newfile
The text "newfile" will be displayed
Nothing will print because newfile is now empty
The text "hello" will be printed
An error will result because newfile points to a file that was removed


When you first log in to a Unix system, the login program performs various security measures. Which is not one of these security measures?
login checks whether the file nologin exists in /etc
login checks on which tty you're coming into the system
login checks if a minimum amount of time passed since your last login
login checks to see if you are not the root (privileged) user


How would you print the content of the file in a reverse?
cat -reverse
printr
print -r
tac


A user reports a problem. In order to gain access to his account in the most secure and non obtrusive way, you...
investigate as root
su to root, and then you su to the user's account
ask the user for his password and login with it
none are correct


You inspect the last access time (atime) instead of the last modification time (mtime) in ls output by using the following switch to ls:
-lm
-la
-lu
-ls


In Unix, a filename cannot have the following character:
all are correct
,
/
\


If FFF is a file, the command 'touch FFF' will:
update the modification time of FFF to the current time
update the access and modification times of FFF to the current time
update the access time of FFF to the current time
update the ctreation, access, and modification times of FFF to the current time


Which of the following is not contained in the inode structure?
User ID of Owner
Date file was modified last
File size
Number of hard links
File name


Which of the following would you use to set yourself as the superuser in a secure way?
su - root
/bin/su -
/bin/su - root
su -


If your umask is 007 it means that default files are created with the permissions:
read+write+execute for the owner or group and no permissions for everyone else
read+write for everyone else and no permissions for the owner or group
read+write+execute for everyone else and no permissions for the owner or group
read+write for the owner or group and no permissions or everyone else


To set a file so that anybody can read it but only root can modify it without changing the file's owner, you use chmod's octal permissions of:
644
400
444
4444


When you check a file's permissions, and there's an "S" in the place of "x" in the owner permissions section of the ls command, it means that the:
System is in fault
uid bit is set
Sticky bit is set
gid bit is set


Changing a file's permissions...
does not change its modification time but will change it's inode's ctime
does not change its modification time and will not change it's inode's ctime
does change its modification time but will not change it's inode's ctime
does change its modification time and will change it's inode's ctime


chmod allows you to specify permissions for a file using octal numbers. 4000 permission is:
Read by owner
Sticky bit
Set group ID on execution (SGID)
Set user ID on execution (SUID)


How do you determine the runlevel of the running system?
rc -l
who -r
grep runlevel /etc/inittab
init -r


True or False: Multiple usernames on Unix are allowed to have the same UID.
False
True


To change the flog file permissions so that others besides you could neither read nor write to it, you do:
chmod go-rx flog
chmod go= flog
chmod go+x flog
chmod go-r flog

No comments:

Post a Comment