File system Flashcards
What is the find option for selecting files accessed n minutes ago?
-amin n
What is the find option for selecting a file accessed one day or more ago?
find -atime n (where n is n*24 hours ago. -atime +1 is a file that was accessed at least two days ago)
what find option will select a file changed n minutes ago?
find -cmin n
what find option will display the results?
find -print
what is a simple example of find to locate a wild card file name?
find . -name thename*.dat -print
start the search in the current directory .
use the name mask “thename*.dat”
print out the results to the screen
what is a find command to locate all core files and then remove them?
find / -name core -exec /bin/rm -f ‘{}’ \;
start in the root directory
use “core” as the name filter
execute the rm command
force the removal without prompting -f
pass the rm command the file name found ‘{}’ \;
What is the find option for selecting files accessed n minutes ago?
-amin n
What is the find option for selecting a file accessed one day or more ago?
find -atime n (where n is n*24 hours ago. -atime +1 is a file that was accessed at least two days ago)
what find option will select a file changed n minutes ago?
find -cmin n
what find option will display the results?
find -print
what is a simple example of find to locate a wild card file name?
find . -name thename*.dat -print
start the search in the current directory .
use the name mask “thename*.dat”
print out the results to the screen
what is a find command to locate all core files and then remove them?
find / -name core -exec /bin/rm -f ‘{}’ \;
start in the root directory
use “core” as the name filter
execute the rm command
force the removal without prompting -f
pass the rm command the file name found ‘{}’ \;
how do you set the sticky bit on an existing directory structure?
find /path/to/directory -type d -exec chmod g+s {} \;
This will recurse through the entire directory structure settingh the GID on all the directory objects (not the files) to the SETGID of the owner of the parent directory. All files created subsequently, will inherit the same GID of the parent directory instead of the default GID of the user who created the file.
what are the daemons used by nfs?
nfsd
rpcbind
rpc. idmapd
rpc. mountd
rpc. rquotad
rpc. statd
what is the tar command for copying an entire directory tree including the file permissions and links?
tar -cf - {source} | (cd {destination}; tar -xvf -)