1/99
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Single character that will allow you to exit the less program in the terminal
q
what happens to a users files when a user account is deleted using sudo userdel?
The files remain attached to the UID of the user account that was deleted
what is the purpose of the su command in Linux
to switch to a different user profile
which of the following best describes what the dmesg command gives you
shows you the message buffer of the kernel
provide the argument to ls that will recursively list a directory's contents
-R or -recursive
Which most frequently is used to connect a harddrive to a motherboard
SATA
Used to change permissions in linux
Chmod
Which of the following switched would allow you to extract a tar.gz file
-xvzf
which of the following is the proper command to archive /Documents/Sales/Docs into a tar ball with name of archivedocs?
Tar -czvf archiveddocs.tar.gz /documents/Sales/Docs
Which of the following best describes the purpose of the /etc/skel directory?
Allows for a default home directory when users profile is first created
Allows new user profiles to be easily set up with the same defaults
what are the default permissions for the /etc/skel
drwxr-xr-x
Which of the following distros would still be receiving security updates
Ubuntu LTS(Long Term Service)
which two special characters would you use to start a BASH script
#!
Which of the following commands would allow you to run the script with its output going into a file with the name of testoutput.txt
./testscript.sh > testoutput.txt
which of the following would be the output of the "free" command
total used free shared buff/cache available(says free)
Type the command to bring up the manual for a command
Man
What would be a possible output of the following command echo*.??
Customers.gz
echo(display line of text)
*(any # of characters)
.(Single Character)
?(Single Alphanumeric)
What is the purpose of the PATH variable
It is used to create a generic script that can be run across multiple machines regardless of the different file paths
Which distros are webservers on linux
NgineX
Apache
which of the following would be the output of the last command
wtmp begins Mon Jul 15 10:04
Which of the following does Red Hat use for its package management
RPM
Which of the following is used for vector graphics
inkscape
Which of the following would allow you to remove the directory assuming it was empty
rmdir Docs19
which of the following would be a proper partition name on a drive
/dev/sdc4
(has to be a single letter drive listed after sd)
which are characteristics of free software
source code must remain freely available to users
software allows users to access and change the source code to fit their needs
What is a linux distro
Different versions of the linux kernel modified to fit more specific functions
What is the single word that indicates the beginning of a loop statement in a bash script
while
What is the default UID value of the root user
0
type the single character that would allow you to split lines in a bash shell script
\
how would you add to the PATH variable
edit the/etc/environment file with a text editor
Which of the following are decedents of RedHat
CentOS
OpenSUSE
which of the following best describes the difference between SSD and HDD
SSD is more likely to survive a fall than HDD
SSD usually has a longer lifespan
Which of the following allow you to turn on the help feature
-h
--help
Shows you the path of your current directory
pwd
which of the following could explain why browser cookies could be considered bad
they contain info to identify the user to the website
which would allow you to bring up help page for the ls command
ls --help
Which of the following are the usual services a cloud service provider might offer
SaaS
IaaS
PaaS
what should you do in order to run the script with the proper permissions
use the "chmod a+x
in an IaaS situation, where would you get the OS for your system
you must provide the OS yourself
which would allow you to copy all files and sub directories into the the /Documents/Finance directory
cp -R /Documents/Sales /Documents/Finance
(what? How? From? To?)
What information can be displayed by top?
Running processes, ordered by CPU or RAM consumption.
Which of the following commands can be used to resolve a DNS name to an IP address?
host
Which of the following permissions are set on the /tmp/ directory?
rwxrwxrwt
Which of the following outputs could stem from the command last?
root tty2 Wed May 17 21:11 - 21:11 (00:00)
Which command adds the new user tux and creates the user's home directory with default configuration files?
useradd -m tux
Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?
tar -cf work.tar ./work/
The current directory contains the following file:
-rwxr-xr-x 1 root root 859688 Feb 7 08:15 test.sh
Given that the file is a valid shell script, how can this script be executed?
./test.sh
bash test.sh
Which of the following commands sorts the output of the command export-logs?
export-logs | sort
Where is the operating system of a Raspberry Pi stored?
On a removable SD card which is put into the Raspberry Pi
What is true about a recursive directory listing?
It includes the content of sub-directories.
whereis
used to search for programs in restricted locations, such as binary file directories, libraries, and man directories.
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)
updatedb
Updates the system managed database of filenames
Displays current working directory
pwd
Change into the current user's home directory
cd ~
cd $HOME
Both of these do what
Change to the parent directory of the current directory
cd ..
Change to the etc directory in the root (/) directory
cd /etc
Creates a hard link named 'format.txt' for the file 'fmt.txt'
ln fmt.txt format.txt
Creates a symbolic link named sym.txt of fmt.txt
ln -s fmt.txt sym.txt
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.
Will update the timestamp of the specified file if it exists. If it does not exist it will not create a blank file.
touch -c file1.txt
Adds the content "Hey there!" to the specified file.
echo "Hey there!" > sample.txt
cat filename.txt
Displays the contents of a file
Opens the vi editor for the file "sample". This will allow you to write text into a file.
vi sample
Will display the "sample" file's byte count
wc -c sample
Displays the number of characters in the "sample" file
wc -m sample
Display the number of lines in the "sample" file
wc -l sample
Display the word count of the "sample" file
wc -w sample
Extracts the first field of the "/etc/passwd" file
cut -f 1 /etc/passwd
Extract the first three characters from the "/etc/passwd" file
cut -c 1, 2, 3 /etc/passwd
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
Search for all the rows containing the string "/home" in the "/etc/passwd" file
grep /home /etc/passwd
Display the number of lines containing the string "/bin" in the "/etc/passwd" file
grep -c /bin /etc/passwd
Display the details of the root user from the /etc/shadow file
grep root /etc/shadow
Search the /etc directory recursively for the string "wlan"
grep -r wlan /etc
Find all the files in the /etc directory having names that start with pass
find /etc -name pass*
List the files in the /etc directory with extensions conf (limit the search to one level)
find /etc -maxdepth 1 -name *.conf
List all the files on system with the permission set 640 (limit the search to two levels)
find / -maxdepth 2 -perm 640
List the files in the var/cache directory owned by the root user (limit the search to two levels)
find /var/cache -maxdepth 2 -user root
find /var/cache -maxdepth 2 -uid 0
List all the files in the /root directory that belong to the root group (do not use shorthand for specifying the directory)
find /root -group root
find /root -gid 0
Sort the contents of the /etc/passwd file, and display it on the stdout
sort /etc/passwd
Numeric sort the third field of the /etc/passwd file and display it on the stdout
cut -f 3 -d ":" /etc/passwd | sort -n
Redirects the output of the echo $HOME command to a file named sample, overwriting its contents
echo $HOME > sample
Appends the output of the pwd command to the sample file
pwd >> sample
Redirects the sample file as an input to the cat command. This will display the contents of the sample file.
cat < sample
Appends only the standard error of the pwd;ech command to the sample file.
pwd;ech 2>> sample
Overwrites the contents of the sample file with the standard output and error of the ls ~ /test command.
ls ~ /test &> sample
Installs the traceroute program on Debian-based systems.
apt-get install traceroute
Whats it do and What distro typically uses it.
Upgrades the system's software
apt-get update
apt-get upgrade
Removes the traceroute package
apt-get remove traceroute
View all processes currently running
ps
Lists all the process that are currently running and are owned by the root user
ps -u root
Displays a dynamically updated list of processes running on the system
top
Displays the system's overall memory usage
free
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
Installs the cups-daemon on the system.
apt-get install cups-daemon
List the files that log information related to the Linux printing system.
ls /var/log/cups
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
Displays the contents of the kernel ring buffer
dmesg
Opens the sample file using the vi editor.
vi sample.txt