星期四, 6月 11, 2009

Managing file ownership in Linux

What does the chgrp command do?

Changes the group to which a file belongs
Changes the owner of a file
Enables a file owner to change file permissions
Sets security attributes



Which option instructs the chown command to disregard any error messages related to the command's operation?

-c
-C
-f
-R




Suppose that you want the transport file to belong to a new group called expenses. The group's ID is 221. Which command enables you to change the group for the file?

chgrp 221
chgrp 221 /home/ksmith/expenses
chgrp 221 /home/ksmith/transport
chmod 221


Suppose that you want to transfer ownership of a file called sales, which was created by Kevin Smith, to Maria Gomez, and you want the file to belong to a group called reviews. You also want to list the file information. Which command do you use to do this?

chown -c mgomez:reviews /home/ksmith/sales
chown -f mgomez:reviews /home/ksmith/sales
chown -R mgomez:reviews /home/ksmith/sales
chown -v mgomez:reviews /home/ksmith/sales

星期三, 6月 10, 2009

Using special permission modes in Linux

Suppose that you want to implement a set user ID (SUID) for the software_data file. You also want to change the permissions for the file to read, write, and execute for the owner, to read only for the group, and to execute for all other users using numeric notation. What is the command you use to do this?

chmod 2741 software_data
chmod 4741
chmod 4741 software_data
chmod 741 software_data



The umask command sets default permissions for all new files you create. What does the command umask 123 do?

It sets file owner permissions to read and write
It sets group permissions to read and execute
It sets group permissions to read only
It sets other users' access rights to write only
It sets the permissions of other users to read





Suppose that you decide to use symbolic notation to specify a set group ID (SGID) for the staff_data file for the group that owns the file. Which command do you use to do this?

chmod g+s staff_data
chmod +s staff_data
chmod s+g staff_data





Suppose that you decide to set a sticky bit for the african_safaris file. You also want to reset the file's permissions using the chmod command. Which command will do this?

chmod +t
chmod +u
chmod u+t african_safaris
chmod t+u african_safaris

星期二, 6月 09, 2009

Setting permissions on Linux files

Suppose that you want to grant permissions to the itineraries file. You want to grant the owner and the primary group full permissions – read, write, and execute – and to grant other users read permission only. Which command do you use to do this?

chmod 666 itineraries
chmod 774 itineraries
chmod g+x itineraries
chmod u+wx itineraries


Which group of letters are the file permissions that apply to a group in the string r--r-xrwx?

r--
r -x
rwx



Which command gives all users full read, write, and execute permissions for the marketing_plan file?

chmod g+x marketing_plan
chmod o-wx marketing_plan
chmod ugo+rwx marketing_plan



Which command do you use to make the /etc/inputrc file immutable?

chattr +i /etc/inputrc
chmod 666 inputrc
chmod g=rw inputrc
ls -l inputrc

星期一, 6月 08, 2009

Using hard and symbolic links in Linux

Which statement applies to a hard link?

It accesses file information by referencing the original file to which it links
It can link to files that don't yet exist
It has the same inode as the file to which it links
It loses all file information if you delete the original file to which it links



The address, or unique identity, of a file is indicated by its ______.

Hard link
Inode
Permissions
Soft link



What permissions do soft links have?

rw-rw-rw-
rwxrwx---
---rwxrwx
rwxrwxrwx


Which command will create a hard link named "Link" to the "Test" file?

ln -h Link Test
ln / Link Test
ln Test Link
ln -s Test Link

星期日, 6月 07, 2009

Finding Linux system files and command locations

Which command do you use to establish the specific version of a command that will be executed?

apropos
slocate
whereis
which




The (            ) command provides a brief summary of a command's function.

apropos
locate
whatis
which




What is the difference between the find and the locate commands in Linux?

The find command searches for files and directories, whereas the locate command searches for commands
The find command searches the file system, whereas the locate command searches for files in a pre-prepared database
The locate command searches for files in real time, whereas the find command searches a prepared list of frequently used files




Which command revises the slocate database according to the most current information available?

apropos
updatedb
whereis
which

星期六, 6月 06, 2009

Exploring the Linux file system hierarchy

What file types does the Linux /opt directory contain?


Application software packages
System binary files
System configuration files
Variable data files




What top-level directory is intended for file storage by the system administrator?

/bin
/boot
/root
/var




Which of the following commands use relative pathnames?

cd /bin
cd documents
cd ../grosetti
cd /home/grosetti



In a Linux file system, what file types does the /etc top-level directory contain?

Shared library files
System binary files
System configuration files
User binary files

星期五, 6月 05, 2009

Linux files

In the output of the ls -l command, which of the following characters indicates that a file is a symbolic link?

a
c
d
l




Which of the following are absolute pathnames?

cd expenses
cd /home/malverez
cd (.) grosetti
cd /usr/markr




What Linux file would you use when performing a rescue after a hard disk problem occurs?

/dev/hda1
/dev/null
/dev/ram
/dev/tty




What characters can you use to name files in Linux?

Ampersand (&)
Dash (-)
Dollar sign ($)
Underscore (_)

推薦此文