INFX 450 Final

  1. What does the Applications menu contain?
    Libre Office, gedit, terminal, writer, sheets
  2. What does the Places menu contain?
    Home folder, filesystem, network shares
  3. What does the System menu contain?
    Encryption & Keys, Printer spool, terminal, user preferences
  4. Cat
    concatenates multiple files and displays the results on screen. Displays a text file
  5. Cd
    change directory to a specified path
  6. Hostname
    Resolve a DNS entry to its IP address
  7. Ls
    List files and folders in a directory path
  8. Passwd
    change the password for a specified user
  9. Pwd
    shows the current working directory
  10. Uname
    shows the name of the OS that is running
  11. Who
    shows all users logged on to the current terminal session
  12. Whoami
    Shows the current logged on user
  13. Illustrate the command that would list all files in the directory that begin with sofa
    Ls –l sofa*
  14. The command that lists all files in the directory that have .txt as an extension
    Ls –l *.txt
  15. The command that would list all files in the directory that contain .from. as part of the filename
    Ls –l *.from.*
  16. Pipe
    Outputs one command as input to another command. Useful for showing how many search results are found. Ex: find . –name *.txt | wc –l
  17. Redirection
    Redirects output to a file instead of the terminal window. Useful for logging purposes. Ex: ls –l > file1.txt > - create file, overwrite if exists. >> - create file, append if exists
  18. What command would you use to change permissions to files and directories?
    Chmod
  19. What are u, g, and o permissions
    • U – Owner Permissions
    • G – Group Permissions
    • O – World Permissions
  20. Using 3 different approaches, how would you set permissions for text3.txt such that owner has read/write access, group has read only, and other has none?
    • Chmod u+r, u+w, u-x, g+r, g-w, g-x, o-r, o-w, o-x /home/foxr/text3.txt
    • Chmod u=rw, g=r, o= text3.txt /home/foxr/text3.txt
    • Chmod 640 /home/foxr/text3.txt
  21. What command would you use to verify that permissions for text3.txt are set correctly?
    Ls –l /home/foxr/text3.txt
  22. What is accomplished by the following command? Find /usr/sbin –name user*
    Find all files starting with user starting in /usr/sbin
  23. What is accomplished by the following command? find ~ -anewer ~/DUMMY-DIRECTORY/file1.txt
    Find all files starting in the user’s home directory that were accessed more recently than ~/DUMMY-DIRECTORY/file1.txt
  24. What is accomplished by the following command? find ~ -size +100c –size -200c
    Find all files starting in the user’s home directory that are larger than 100 bytes and smaller than 200 bytes
  25. Rm
    remove a file
  26. Hostname
    Resolve a DNS entry to an IP address
  27. Passwd
    Change the password for a specified user
  28. Mv
    move a file/directory from one place to another
  29. Uname
    shows the name of the OS that is running
  30. PID
    Process ID. Unique number given to a process. ID’s are sequential
  31. PR
    Priority. The importance each process is given to the system. High priority = high importance.
  32. NI
    Nicesness. How “nice” a process is in relation to other processes. More nice = lower priority.
  33. %CPU
    Amount of CPU a process is using
  34. %MEM
    Amount of RAM a process is using
  35. Describe briefly the niceness value of a process’s priority
    Niceness refers to how willing a process is in letting others use its resources. A high nice value means the process is willing to give other processes priority over it, meaning the process has a high priority. A low niceness means the process is “greedy” and has a high priority not willing to share its resources.
  36. Nice – n -15 find ~ -name *.txt > found_files &
    • Start the find process with a niceness of -15 and run in the background
    • Will find all files starting in the user’s home directory that end in .txt and will go through each subdirectory. The results are stored in found_files.
  37. Nice –n 15 ./myscript < inputfile > outputfile &
    • Start myscript process with a niceness of 15 and run it in the background
    • Will run a script passing in the contents of inputfile and storing the output of the script in outputfile.
  38. Renice –n 5 18311
    Reassign a nice value of 5 to the process whos PID is 18311. Run in foreground.
  39. Renice –n 19 –u foxr zappaf
    Reassign a nice value of 19 to all processes owned by the users foxr and zappaf
  40. Renice –n -10 –p 23813 24113 26729
    Reassign a nice value of -10 to the processes that have PID’s of 23813, 24113, and 26729
  41. Open a file in vi
    Vi file or :o file
  42. Save a file in vi
    :w filename
  43. Exit vi
    :q
  44. Describe the concept of “regular expressions” and include at least two examples
    • Regular expressions are search patterns that can be used to find strings that match a given expression. Generally, they will match the first part of the string that contains the pattern, even if there are multiple occurrences.
    • Ex: ^[0-9]{5} will find all string that begin with at least 5 numbers [[:space:]][A-Z]{2}[[:space]][0-9]{5}$ will find all strings that contain a space, followed by 2 capital letters, followed by another space, followed by 5 numbers and ends the string. ^IL^60004
  45. #!/bin/bash
    show what shell we are using
  46. read –p “Enter three numbers: “ X Y Z
    Display the message and store the user input into X, Y, and Z
  47. If [ $X –gt $Y ]
    If the value stored in X is greater than the value stored in Y
  48. Then
    Then do
  49. If [ $X – gt $Z ]
    If the value stored in X is greater than the value stored in Z
  50. Then Largest=$X
    Then assign Largest to be the value stored in X
  51. Else Largest=$Z
    Then assign Largest to be the value stored in Z
  52. Fi
    End the indented if block
  53. Elif [ $Y –gt &Z ]
    Else if the value stored in Y is greater than the value stored in Z
  54. Then Largest=$Y
    Then assign Largest to be the value stored in Y
  55. Else Largest=$Z
    Else assign Largest to be the value stored in Z
  56. Fi
    End the large if block
  57. Passwd username
    will change the password of username. If no name is specified, root’s password will be changed.
  58. Private group
    group that belongs only to the user that created it
  59. Useradd –c
    comment
  60. Useradd -d
    Specify the home directory of the new account
  61. Useradd -e
    Expiration date of the new account
  62. Useradd -G
    list of supplementary groups of the new account
  63. Useradd -s
    login shell of the new account
  64. Useradd -M
    Don’t create home directory
  65. Useradd -D
    alter defaults (no parameters displays defaults)
  66. Groupadd groupname
    –g GID
  67. Suzie Creamcheese, creamcheeses, default login shell /bin/tcsh
    Useradd –m –c “Suzie Creamcheese” –s /bin/tcsh creamcheeses
  68. Eric Cartman, cartmane, groups cit371 and informatics, UID of 1001
    Useradd –m –c “Eric Cartman” –G cit371,informatics –u 1001 cartmane
  69. Userdel username
    –r deletes everything
  70. /etc/password
    shows all user accounts
  71. /etc/group
    shows all info about groups
  72. /etc/shadow
    shows hashed password info
  73. chage –l username
    shows password info
  74. chage –M
    maximum number of days between password change
  75. chage –W
    number of days of warning before password expires
  76. chage –E
    Password expiration date
  77. chage –I
    inactivity period (account will be locked after password has expired if it hasn’t been changed in this time)
  78. Passwd username
    change the password of username
  79. Passwd username –l
    lock user account
  80. Passwd username –u
    unlock user account
  81. Defaults for useradd
    are stored in /etc/login.defs
  82. useradd –D
    change defaults (no parameters show defaults)
  83. /etc/sudoers
    modifies the sudo command
  84. username machine=command
    Lets username run a specified command on machine (usually localhost)
  85. Df
    reports disk file space usage (in 1K blocks)
  86. Df –a
    shows all
  87. Df –h
    shows the size of partitions in human-readable context (GB, MB, TB, etc.)
  88. Df –k
    shows 1K blocks total, used, and available
  89. Df –i
    Shows number of inodes that are used by each filesystem
  90. /etc/fstab
    shows mounted devices at boot time
  91. /etc/mtab
    shows what is currently mounted
  92. /etc/mtab rw
    read/write
  93. /etc/mtab ro
    read only
  94. tempfs
    stores temporary files, stored in RAM
  95. sysfs
    virtual file system that stores info about kernel subsystems, hardware devices, and device driver files
  96. devpts
    provides an interface to terminal devices
  97. telinit 1
    change to runlevel1
  98. umount directory
    unmounts directory
  99. mount device mountpoint
    will mount device as mountpoint
  100. mount /dev/sda5 /home
    will mount /dev/sda5 as /home/
  101. -a
    will mount all partitions specified in /etc/fstab
  102. stat
    shows information about a file or files
  103. stat –f dev
    will show the file mount point
  104. stat –c
    allows you to specify codes
  105. stat –c %n
    print filename
  106. stat –c %A
    human readable format
  107. stat –c %i
    inode number
  108. stat –c %F
    file type
  109. stat –c %s
    total size in bytes
  110. stat –c %Z
    time of last change since epoch
  111. stat –c %h
    hard links
  112. swapon
    turns on swap space
  113. swapon –s
    stats
  114. swapon –a
    all
  115. swapoff –a
    disable all swap spaces
  116. /boot
    used to store files needed to boot system
  117. vmlinuz
    name of Linux kernel executable
  118. Grub
    bootloader for Linux
  119. /proc
    • directory for running processes by PID
    • cmdline tells you path the process is located, can be called/accessed
    • key-users: users that are able to use the process
  120. /bin
    used by both sys admins and users
  121. /usr/bin
    primary directory of executable commands on the system
  122. /usr/local
    used when installing software locally. Protected from being overwritten during system updates/installs
  123. sticky bit
    controls activities of world-writable directories
  124. t instead of x
    in the world permissions
  125. chmod 1### or chmod +t
    Useful for ensuring users cannot accidentally erase other user’s work in a shared folder
  126. Tar –cf name path
    will create a new tar file called name consisting of everything in path
  127. Tar –tf name
    will display table of contents of name
  128. Tar –z
    automatic compression
  129. dmesg
    shows all messages captured during bootup
  130. write-back
    data written to cache every time a change occurs, but only written to memory under certain conditions or specified intervals
  131. uncacheable
    memory cannot be stored for future use
  132. DMA
    Direct Memory Access: Allows certain hardware systems to access RAM independently of CPU
  133. IRQ
    Interrupt Request: Hardware signal sent to CPU that temporarily stops a running program and allows interrupt handler to run instead
  134. PnP
    Plug and Play
  135. Rootfs
    • special tempfs image used in initram. Init will overwrite rootfs with mounted / file system
    • Mounted physically at /dev/sda1
  136. Init
    responsible for establishing user environment after hardware has been initialized and file system mounted
  137. /etc/inittab
    startup script
  138. id:runlevel:initdefault
    start the machine using the specified runlevel value
  139. runlevel 0
    halt (Do NOT set initdefault to this)
  140. runlevel 1
    single user mode
  141. runlevel 2
    multiuser, without NFS (same as 3, if you do not have networking)
  142. runlevel 3
    full multiuser mode
  143. runlevel 4
    unused
  144. runlevel 5
    X11
  145. runlevel 6
    reboot (Do NOT set initdefault to this)
  146. rc.sysinit
    initializes system functions
  147. Rc.conf
    • For I in /etc/rc$runlevel.d/K*
    • for I in /etc/rc$runlevel.d/S*
  148. runlevel.d
    • variable for runlevel value
    • processes are executed(K)/stopped(S) at their respective runlevels
  149. chkconfig
    shows which runlevel a service is running
  150. chkconfig servicename off
    will turn off servicename
  151. chconfig sshd off –level 2
    will turn off runlevel2 for sshd
  152. chkconfig httpd on  --level 5
    will turn on runlevel5 for httpd
  153. Enabled
    Automatically Start
  154. Disabled
    Automatically Stop
  155. /sbin/service name status
    • name – name of service
    • status – particular action
    • start – start the service
    • stop – stop the service
    • restart – restart the service
    • status – show the status of the service
  156. /etc configuration files
    cron uses anacrontab
  157. cron.daily
    processes run daily
  158. cron.weekly
    processes run weekly
  159. cron.monthly
    processes run monthly
  160. config
    Specifies parameters of variables that are used when running
  161. rules
    parameters that are passed when running
  162. chkconfig 2345 11 88 (/etc/init.d/auditd)
    • 2345 – default run levels for the service
    • 11,88 – S(stop,11) and K(run,88) symbolic links. Order which service will be started and stopped in the respective runlevels
  163. rsyslog
    system logger, logs activity to log files
  164. rsyslog.conf
    configuration file for rsyslog daemon
  165. Daemon.*
    specify all daemon activity should be logged
  166. /var/log/daemons
    activity should be logged here
  167. eth0
    Ethernet address
  168. lo
    loopback address
  169. /etc/sysconfig/network-scripts
    scripts for network service
  170. ifdown interface
    shuts down network interface
  171. ifdown interface eth0
    shuts down eth0, lo still works
  172. ifdown interface lo
    shuts down all network communication
  173. ifup interface
    brings up network interface
  174. ifcfg-eth0
    configuration file for eth0
  175. BOOTPRO=method
    DHCP or STATIC depending on addressing
  176. ONBOOT=yes/no
    specify whether interface starts on boot time
  177. HWADDR
    MAC address of hardware interface
  178. Ifcfg-lo
    configuration file for lo
  179. IPADDR
    IP Address
  180. NETMASK
    subnet mask
  181. NETWORK
    gateway address
  182. BROADCAST
    network broadcast address
  183. /etc/resolv.conf
    • DNS zone name file
    • machine will look here for name servers
  184. /etc/hosts
    modifies localhost name server
  185. route
    shows IP routing table
  186. ip route show table local
    shows entire local routing table
  187. ip route flush table local
    flushes entire local routing table
  188. ip neigh show
    shows computer’s ARP address
  189. Address Resolution Protocol
    address computer sends to gateway
  190. Arp –e
    shows ARP address
  191. Arp –d ipaddr
    removes ARP address for ipaddr
  192. Iptables
    firewall rule file (/etc/sysconfig/iptables)
  193. Iptables SAVE_ON_STOP
    specifies whether rules are saved when service is stopped or not
  194. Iptables STATUS_LINENUMBERS
    shows line numbers in output or not
  195. Iptables –A
    • append rule to a rule chain
    • INPUT – incoming traffic
    • OUTPUT – outgoing traffic
    • FORWARD – port forwarding
  196. Iptables -m
    • allows rules to match based on connection state
    •     --state
    •               ESTABLISHED – connection is already established
    •               RELATED – connection is new, but related to another connection already permitted
    •                NEW – connection has not yet been seen
    •                 INVALID – Traffic could not be identified
  197. Iptables –j
    • Jump to specified target
    • ACCEPT – accept packet and stop processing rules in current chain
    • REJECT- reject packet and notify sender, stop processing rules in current chain
    • DROP – silently ignore packet (don’t notify sender), stop processing
    • LOG – Log packet, continue processing
Author
ass9235
ID
312970
Card Set
INFX 450 Final
Description
INFX 450 Final
Updated