Linux+ Study

  1. what does "tar -t achive.tar" do ?
    list the contents of archive.tar, or --list.
  2. what does "tar -r archive.tar file" do ?
    Appends the file "file" to the end of the archive. Also --append can be used
  3. On which block is the first redundant copy of the partition's super block stored by default on an ext4 filesystem ?
    32768
  4. What is the command to create a swap partition on the second SATA drive first partition?
    mkswap /dev/sdb1
  5. What is the command to enable the swap partition on the second SATA drive first partition ?
    swapon /dev/sdb1
  6. What type of backup backs up all filles modified since the last full backup, and does NOT flag the files as having been backed up ?
    Differential Backup
  7. In command mode for fdisk what does "p" do ?
    print extisiting partitions on the drive.
  8. In fdisk command mode what does "n" do ?
    create a new partition on the disk.
  9. What is the command to check a digital signature of an rpm file ?
    rpm --checksig package.rpm
  10. What is the command to test dependancies of an rpm without installing ?
    rpm -i --test package.rpm
  11. What is the the command to install an rpm regardless of the dependancies ?
    rpm -i --nodeps package.rpm
  12. What is the command to list all packages that require an rpm ?
    rpm -q --whatrequires
  13. What is the command to list all files incuded in an rpm ?
    rpm -ql package.rpm
  14. What is the command to show what a package provides ?
    rpm -q --provides
  15. What is the command to show what rpm package provides the function?
    rpm -q --whatprovides
  16. What is the rpm command to get specific detailed information about a package ?
    rpm -qi package.rpm
  17. What is the command to verify an installed package ?
    rpm -V packagename
  18. What is the command to convert an rpm to a cpio archive ?
    rpm2cpio package.rpm > package.cpio
  19. In what directory are yum repositories stores ?
    /etc/yum.repos.d
  20. When using the dpkg utility what does -P option do ?
    -P Uninstalls the package AND deleted all of the configuration files.
  21. What is the command to install package.deb
    dpkg -i package.deb
  22. What is the command to to display information about a deb package that is not installed on the system ?
    dpkg -I package.deb
  23. What is teh command to see information about a deb package that is already installed?
    dpkg -p package.deb
  24. What does dpkg -l do ?
    lists all installed packages on the system.
  25. What does dpkg -L package.deb do ?
    Lists all files that were installed by the package.
  26. what does dpkg -S filename do?
    Identifies the package that installed filename.
  27. What does dpkg -rB do ?
    Disables other packages that are dependant on the package being removed.
  28. What does dpkg -iG do ?
    Does not install the package if a newer version is already installed.
  29. What does dpkg -iE do ?
    Does not install the package if the same version is already installed.
  30. What is the apt command to show information about a package ?
    apt-cache showpkg packagename
  31. What is the APT command to show all dependancies for a package name ?
    apt-cache depends packagename
  32. What is the APT command to search for installed packagenames ?
    apt-cache pkgnames packagename
  33. What does "apt-get upgrade" do ?
    Upgrades all installed packages to the newest version.
  34. What does "apt-get dist-upgrade" do ?
    Upgrades all installed packages to the newest version, but avoids upgrading packages if the upgrade would break a dependency.
  35. What does "apt-get clean" do ?
    Removes all outdated information from the package database.
  36. What is the apt-get command to verfy the integrity of installed packages as well as the package database ?
    apt-get check
  37. What does thr -d option for for both upgrade and install using the apt-get command do ?
    Downloads the packages, but does not install them.
  38. What does "apt-get -s install ntp" do ?
    Simulates the install, but does not actually install it.
  39. What is the apt-get option to fix if possible any unmet dependancies ?
    the -f option.
  40. What is the command to view a list of all shared libraries on your Linux system ?
    ldconfig -p
  41. What is the command to view the libraries required bya specific application ?
    ldd -v executable_filename
  42. What two places are searched when for libraries ?
    The /etc/ld.so.cache file and the LD_LIBRARY_PATH environment variable.
  43. What is the command to rebuild the library cache ?
    ldconfig
  44. What uname option shows the linux kernel's name ?
    unames -s
  45. What uname option shows the hardware platform ?
    uname -i
  46. What uname option shows the systems host name ?
    uname -n
  47. What uname option shows the processor type ?
    uname -p
  48. What uname option shows the hardware achitecture (x86_64) ?
    uname -m
  49. What is the option used with man to serach for a keyword across all man pages ?
    man -k keyword
  50. What Man page manual section is "Library Functions"?
    manual section 3
  51. What Man page manual section is "Games" ?
    manual section 6
  52. What Man page manual section is 8?
    Administrative utilities used by root user.
  53. What man section is 9 ?
    kernel routine documentation.
  54. What shell variable is used to store shell prompt format.
    $PS1
  55. Which configuration file is first read when a login bash shell is run ?
    /etc/profile
  56. What file can be used to configure the path to man page files ?
    /etc/man_db.conf
  57. What does grep -l "name" do ?
    Display only the filename "name" was found in and not the matching text.
  58. What does grep -n "name" * do ?
    displays the matching text, file name and line numbers.
  59. What is the name of the daemon for locate.
    updatedb
  60. What does "whereis -b" show ?  -m ?
    -b show the path to the binary, and -m for the location of man pages.
  61. What is the option for mkdir that allow you to create directories and subdirectorys in one command ?
    mkdir -p /stuff/morestuff
  62. What is the GID of this entry from /etc/passwd
    klette:x:1004:1005::/home/klette:/bin/bash
    1005
  63. What is the status of this user :
    /etc/shadow
    klette:*:14839:0:99999:7:::
    * means the account is locked.
  64. What does useradd -D do ?
    Shows the defaults for newly added logins.
  65. What does the comand pwck do ?
    verifies integrity of password files
  66. What files stores the default settings for new users ?
    /etc/default/useradd
  67. What file stores the default settings for new users in  /etc/shadow?
    /etc/login.defs
  68. What directory stores default hidden files for newly added users ?
    /etc/skel
  69. What does the -M option do for useradd  ?
    Adds user without a home directory.
  70. What does the -m option do for useradd ?
    create a home directory for the user.
  71. What does the -G option do for useradd or usermod ?
    list of supplementary groups.
  72. What does the -e option do for useradd or usermod?
    date on which the accoount will expire.
  73. What does the -f option do for useradd or usermod ?
    Days after a password expires until account is disabled.
  74. What does the -g option do for useradd ?
    Name or number of the user's primary group.
  75. What does the -s option do for useradd or usermod?
    specify the user's shell
  76. What does the -u option do for useradd or usermod ?
    manually specify the uid. (by number)
  77. What does the -r option do for useradd ?
    create a "system" account, same as --system
  78. What does the -p option do for useradd or usermod?
    specify crypt password.
  79. What does passwd -S <user> do ?
    report the password status for an account.
  80. What is the comand to unlock a password for a user ?
    passwd -u <user>; or --unlock
  81. What is the comand to lock a password for a user ?
    passwd -l <user>, or --lock
  82. What is the comand to delete a password for a user ?
    passwd -d <user>,  or --delete
  83. What does "passwd -m 3 <user>" do ?
    Sets the Minimum days before a password can be changed to 3 days, or --mindays
  84. What does "passwd -x 3 <user>"do ?
    This sets the maximum bumber of days a password remains and valid before it must be changed. or --maxdays
  85. What does "passwd -i 3 <user>" do ?
    Sets the number of days the can be accessed after expiration. or --inactive
  86. What does "passwd -w 3 <user>" do ?
    Set the number of days until a password change is required. or --warndays
  87. What does usermod -c "txt" do ?
    adds a comment to the user account "txt"
  88. What does "usermod -U ,user> " do ?
    unlock the user account; or --unlock
  89. What does the "usermod -d" do ?
    Allows you to specify a new home directory location
  90. What does "usermod -l <user> " do ?
    Specficy a new login name
  91. What does "userdel -r <user>" do ?
    Removes the user and home directory and mail spool entries.
  92. What does the -r option do for groupadd ?
    adds a system group
  93. What does the -g option do for groupadd ?
    Allows you to specify a GID
  94. What does the -p option do for groupadd ?
    Specify an encrypted  password.
  95. What does "groupmod -A "ksanders" dbusers" do ?
    Adds ksanders to the dbusers group.
  96. What does "groupmod -R "ksanders" dbusers" do ?
    Removes ksanders from the dbusers group.
  97. what does "chmod 4644 testfile" to testfile ?
    • SUID - set user id
    • -rwSr--r-- 1 sethwalt sethwalt 0 Oct 25 14:42 testfile 
  98. What does "chmod 2644 testfile" do ?
    • SGID - set group id
    • -rw-r-Sr-- 1 sethwalt sethwalt 0 Oct 25 14:42 testfile 
  99. What does "chmod 1644 testfile" do ?
    • Sticky bit - only applies to directory
    • -rw-r--r-T 1 sethwalt sethwalt 0 Oct 25 14:42 testfile 
  100. Explain sticky bit :
    Users can only delete files within the directory for which they are owner of the file or directory itself
  101. Explain SGID :
    Set group id only applied to binary executables. When a file is executed,  the user who runs,  temporarily becomes a member of the file's group. Also whe SGID is set the file is set to the group of the parent dirctory when created.
  102. Explain SUID:
    Set user id only applied to binary executables .  When run the user who runs the file is temproarily the owner.
  103. What 2 entries need to be added to the /etc/fstab file to enable quotas?
    usrquota and grpquota to the options section.
  104. What does the command dmsg | more display ?
    Messages displayed during boot process.
  105. What is the bash command to create a grub password hash?
    grub-md5-crypt
  106. What need to be entered in /etc/grub.conf file for a password ?
    • "password x" or
    • "password -md5 $alkjlsafi9230r9f" for md5 hashes.
  107. What directive needs to be added to a section in the grub.conf file to require the user to use a password ?
    "lock"
  108. Which runlevel halts the system ?
    0
  109. Which runlevel reboots the system ?
    6
  110. What is the command that  removes init scripts and runlevels for daemon ?
    insserv -r <service name>
  111. What is the command that adds init scripts and runlevels for daemon ?
    insserv <service name>
  112. What is the command that  sets runlevels for daemon to the defaults ?
    insserv -d <service name>
  113. what is the insserv syntax to set ntp to run levels 3 and 5 ?
    insserv start=3,5
  114. What is the command to build a module dependance list ?  What is the location of the file ?
    depmod; /lib/modules/2.6.28-11-generic/modules.dep
  115. What is  the daemon that creates a virtual file system mounted at /dev and communicates to the Linux kernel through the uevent interface.
    udev
  116. IEEE 1394 allows you to connect up to how many devices ?
    63
  117. USB allows you to connect up to how many external devices to the PC ?
    127
  118. ISA or PCI devices cannot share an interrupt ?
    ISA
  119. Can Two PCI devices can share interrupts ?
    Yes
  120. Can A PCI device  share an interrupt with an ISA device.
    No
  121. What does the cut -d option do ?
    specifies the character the is the delimiter for fields.
  122. What does the cut -f1 <file>do ?
    displays the first field for every line in the file.
  123. what does
    echo "monkeys" | cut -b 2  or
    echo "monkeys" | cut -c 2 do  ?
    -c for characters and -b for bytes  both display "o"
  124. What does the "expand" command do ?
    coverts all TABs in a file to spaces.
  125. What does "unexpand" do ?
    Converts all spaces in a file to TABs
  126. What does "fmt -w 80 longfile " do ?
    sets the max width of the lines in the file to 80 char.
  127. Explain join -j 1 file1 file1; what do the files contain
    Join the lines from file 1 and file 2, based on the mating join field 1. IE the lines are numbered in each file.
  128. Explain paste file1 file2
    Match by lines (regardless of content) from file 1 and file 2 separated by a tab.
  129. What does "nl file1" do ?
    numbers each line
  130. What does "pr -d -l 10 -o 10 testfile" do ?
    Format file for printing : -d double space, -l number of lines; -o set a margin.
  131. What do the awk options n, f, r, t do ?
    t Inserts a Tab character.  n Adds a newline character.f Adds a form feed character.  r Adds a carriage return character
  132. What to the sort options -f, -M, -n, -r do ?
    -f Fold lowercase characters to uppercase characters.  -M Sort by month. -n Sort numerically.  -r Reverse the sort order
  133. What does "cat lastnames | tr a-z A-Z" do ?
    Changes every letter in the file to Upper case.
  134. What do the uniq options -u and -d do ?
    -d Only print duplicate lines.  -u Only print unique lines
  135. What do the wc options, -c, -m, -l, -w do ?
    -c Print the byte counts.  -m Print the character counts.  -l Print the newline counts.  -L Print the length of the longest line.  -w Print the word counts.
  136. What do the cpio options -i, -o, -p, -v do?
      -i, --extract              Extract files from an archive (run in copy-in  -o, --create               Create the archive (run in copy-out mode)  -p, --pass-through         Run in copy-pass mode  -v, --verbose              Verbosely list the files processe
  137. What does killall -u jon do ?
    kills all processes for user jon
  138. What signal is SIGHUP ?
    SIGHUP kill signal 1 restarts the process
  139. What signal is SIGINT?
    SIGINT kill signal 2 ends a ctrl C
  140. What signal is SIGKILL ?
    SIGKILL kill signal 9 brute force kill
  141. What signal is SIGTERM ?
    SIGTERM kill 15 tells the process to terminate immediatly
  142. What does killall  do ?
    kills all processes by name.
  143. What is nohup used for ? nohup updatemydb &
    To continue to run the process even when user logs out.
  144. using the at command when is teatime ?
    4Pm
  145. What is the atq command used for ?
    To see what at jobs are qued to run.
  146. What is the atrm command used for?
    To remove qued at commands, but job number.
  147. What does the ps command do, ps -e ? ps -ef ? ps -efl?
    • ps - display processes in current shell
    • ps -e - all processes
    • ps -f show more detail :
    • ps -l even more detail :
  148. What does quotacheck -amvug do?
    -a Checks all mounted file systems. -m Forces check on mounted file systems. -u Checks users.-g Checks groups. -v Operates in verbose mode.
  149. When quotacheck is complete what 2 files are created ? Where are they? 
    Two files named aquota.user and aquota.group should have been created in the mount point of your mounted file system.
  150. What is the command to enable quotas on the filesystem?
    quotaon -av
  151. What is the command to edit quotas for a user?
    edquota -u username
  152. What is the command to copy quotas from one user to another ?
    edquota -p user1 user2
  153. What is the command to edit quotas for groups?
    edquota -g groupname
  154. What is the default grace period for quotas? What is the command to change it  ?
    7 days, edqouta -t
  155. What is the command to see a quota report for all users ?
    repquota -av
Author
sethwalton
ID
182791
Card Set
Linux+ Study
Description
Questions for LX101
Updated