Docsity

010-160: LPI Linux Essentials Study Guide, Study Guides, Projects, Research of Computer Science

Toggle sidebar
bg1
1
/
9
010-160: LPI Linux Essentials Study Guide
1.
Where is:
used to search for programs in restricted locations, such as binary file directories, libraries, and man
directories.
2.
locate:
Searches the system managed database of filenames for files containing the specified string in the filenames.
(Search is much faster than the search performed using the 'find' command)
3.
updated:
Updates
the
system
managed
database
of
filenames
4. Displays current working directory: pwd
5. Change into the current user's home directory: cd ~
cd
$HOME
Both
of
these
do
what
6. Change to the parent directory of the current directory:
cd
..
7. Change to the etc directory in the root (/) directory: cd /etc
8.
Creates a hard link named 'format.txt' for the file 'fmt.txt':
ln fmt.txt
format.txt
9. Creates a symbolic link named sym.txt of fmt.txt:
ln
-s
fmt.txt
sym.txt
10.
touch:
Can be used to update the timestamp of a file or if that file doesn't exist it will create a blank file with the
specified name.
11.
Will update the timestamp of the specified file if it exists. If it does not exist
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download 010-160: LPI Linux Essentials Study Guide and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

1 / 010-160: LPI Linux Essentials Study Guide

  1. Where is: used to search for programs in restricted locations, such as binary file directories, libraries, and man directories.
  2. locate: Searches the system managed database of filenames for files containing the specified string in the filenames. (Search is much faster than the search performed using the 'find' command)
  3. updated: Updates the system managed database of filenames
  4. Displays current working directory: pwd
  5. Change into the current user's home directory: cd ~ cd $HOME Both of these do what
  6. Change to the parent directory of the current directory: cd ..
  7. Change to the etc directory in the root (/) directory: cd /etc
  8. Creates a hard link named 'format.txt' for the file 'fmt.txt': ln fmt.txt format.txt
  9. Creates a symbolic link named sym.txt of fmt.txt: ln -s fmt.txt sym.txt
  10. touch: Can be used to update the timestamp of a file or if that file doesn't exist it will create a blank file with the specified name.
  11. Will update the timestamp of the specified file if it exists. If it does not exist

2 / it will not create a blank file.: touch -c file1.txt

  1. Adds the content "Hey there!" to the specified file.: echo "Hey there!" > sample.txt
  2. cat filename.txt: Displays the contents of a file
  3. Opens the vi editor for the file "sample". This will allow you to write text into a file.: vi sample
  4. Will display the "sample" file's byte count: wc -c sample
  5. Displays the number of characters in the "sample" file: wc -m sample
  6. Display the number of lines in the "sample" file: wc -l sample
  7. Display the word count of the "sample" file: wc -w sample
  8. Extracts the first field of the "/etc/passwd" file: cut -f 1 /etc/passwd
  9. Extract the first three characters from the "/etc/passwd" file: cut -c 1, 2, 3 /etc/passwd
  10. Extracts the third field from the "/etc/shadow" file and uses the : seperator. Since "/etc/shadow" is a : (colon) seperated file, this command will display only the content of the third field in the file.: cut -d ":" -f 3 /etc/shadow
  11. Search for all the rows containing the string "/home" in the "/etc/passwd" file: grep /home /etc/passwd
  12. Display the number of lines containing the string "/bin" in the "/etc/passwd"

4 / stdout: cut -f 3 -d ":" /etc/passwd | sort -n

  1. Redirects the output of the echo $HOME command to a file named sample, overwriting its contents: echo $HOME > sample
  2. Appends the output of the pwd command to the sample file: pwd >> sample
  3. Redirects the sample file as an input to the cat command. This will display the contents of the sample file.: cat < sample
  4. Appends only the standard error of the pwd;ech command to the sample file.: pwd;ech 2>> sample
  5. Overwrites the contents of the sample file with the standard output and error of the ls ~ /test command.: ls ~ /test &> sample
  6. Installs the traceroute program on Debian-based systems.: apt-get install traceroute Whats it do and What distro typically uses it.
  7. Upgrades the system's software: apt-get update apt-get upgrade
  8. Removes the traceroute package: apt-get remove traceroute
  9. View all processes currently running: ps
  10. Lists all the process that are currently running and are owned by the root

5 / user: ps -u root

  1. Displays a dynamically updated list of processes running on the system: top
  2. Displays the system's overall memory usage: free
  3. Display a summary of services that are started via SysV scripts. /var/log/boot.log contains messages that are logged during system boot.: cat /var/log/boot.log
  4. Installs the cups-daemon on the system.: apt-get install cups-daemon
  5. List the files that log information related to the Linux printing system.: ls /var/log/cups
  6. Displays the contents of the file that contains messages from daemons that do not have their own dedicated log file. File contains global log messages: cat /var/log/syslog
  7. Displays the contents of the kernel ring buffer: dmesg
  8. Opens the sample file using the vi editor.: vi sample.txt
  9. You would press i to enter the insert mode. You would press the esc key to exit insert mode. You would type :wq command to quit the vi editor.: How would you enter the insert mode in the vi editor? How would you then exit the insert mode and then exit the program while saving the changes?

7 /

  1. Used to chain commands together: What is the ';' symbol used for?
  2. Command that replaces all occurrences of the word scrt with script.: - :%s/scrt/script/g
  3. Variable that holds the exit status of the last executed command or script: $?
    • name of script
  • First Parameter
  • Second Parameter: When used inside a shell script the following refer to what: $ $ $
  1. Displayed using the netstat command: - Routing table
  • Network interface information
  • List of open ports

8 /

  1. usermod - d Used to specify a new home directory usermod - m When included with the -d option, the contents of the previous home directory are moved to the new directory as well.: What two options of the command 'usermod' can be used to move a user's home directory (files included) to a new location?
  2. Used to change the UID of a user account: What does the following command do: usermod -u
  3. Used to modify a user's login name.: What does the following command do: usermod -l
  4. a normal data file. Can be simple txt files, scripts, graphics, and so on. Present in the beginning of the file's permission string.: The '-' filetype code identifies what?
  5. a disk directory: The 'd' filetype code identifies what?
  6. Specifies that the device is a block device from which data is transferred in blocks of more than 1: The 'b' filetype code identifies what?
  7. refers to a character device. Data transfers in these devices takes place in units of 1 byte.: The 'c' filetype code identifies what?