Linux Academy - Linux Essentials Flashcards
What does GNU stand for?
Gnu is Not Unix
What does GPL stand for?
General Public License
“What does ““Copy-left”” refer to?”
Communicates the idea of the guaranteed right to copy software.
What does FSF stand for?
Free Software Foundation
When was the FSF founded?
1985
Who founded the FSF?
Richard Stallman
”"”Free as in speech, not free as in beer”” refers to what?”
Free does not necessarily refer to price
What four software freedoms define the FSF?
1.) Freedom to usethe software for any purpose2.) Freedom to examine the source code and modify it as you see fit.3.) Freedom to redistribute the software4.) Freedom to redistribute your modified software
What are the two major version of the GNU GPL in use today?
GPLv2 and GPLv3
Give an example of something that uses the GPLv2.
The Linux kernel
What is the major difference of the GPLv3 too the GPLv2?
The GPLv3 stop restrictive hardware.
Which GPL’s does the FSF support?
V2 and v3 only.
What is the LGPL?
Lesser General Public License. Used for libraries (collections of code).
What is the GNU FDL?
GNU Free Documentation License. Used to license open source documentation.
What is the OSI?
The Open Source Initiative.
Who founded the OSI?
Bruce Perens and Eric Raymond
When was the OSI founded?
1998
What was the primary concern that caused the OSI to be founded?
The FSF seemed threatening to some businesses. The OSI is less dogmatic and more friendly to businesses.
What does the OSI do?
Promotes software in the business world.
What is open source?
A development method for software that harnesses the power of the distributed peer review and transparency processs. The promise of open source is better quality, higher reliability, more flexibility and lower cost and an end to proprietary lock in.
What are some of the licenses that fall under the OSI?
GPL and LPHP, Apache, MIT, BSD, FreeBSD, MPL2 (Mozilla), NCSA, OpenLDAP, Public Domain, PHP License
“In reference to the GPL, complete the following statement: ““The derived work must also be distributed under the..”””
GPL
What is the single largest difference between the FSF and OSI?
Under certain licenses (MIT and Apache) the OSI does not object to companies have closed source software. Opposite to this, under FSF licensing you must distribute your source code. Free does not necessarily mean price.
What does FOSS stand for?
Free and Open Source Software
What are the 3 characteristics of FOSS?
1.) Computer software that can be classified as both free software and open source software. That is, anyone with this license is free to use, copy, study and modify the software in any way.2.) The source code is shared, encouraging people to voluntarily improve the design of the software.3.) This is in contrast to propietary software, where software is under copyright and the source is usually hidden.
What are the core OSI principles?
1.) Permission to derice works: License permits others to modify distributed software under the same license as the orginal.2.) Respect for source code integrity: The license may restrict redistribution of modified source but only if the patch files may be distributed along with original source code.3.) No discrimination against persons or race4.) No discrimination against fields of endeavor5.) Automatic license distribution: License must apply to anyone who receives the program with out needing a seperate agreement.6.) Lack of product specificity: The license must not require that the program be used or distributed as past of a larger program.7.) Lack of restrictions on other software: Can’t restrict other software bundled with software8.) Technologically neutral.
Define the Free in FOSS
The code must always be available.
True or false: Under the GPL and FSF that uses a code under the GPL has to then release any new code under the GPL.
True
What are the major open source licenses?
BSDMIT (X11 License)ApacheArtisticNetscape Public License (NPL)Mozilla Public License (MPL)General Public License (GPL)Lesser General Public License (LGPL)
Give two examples of software that doesn’t qualify as open source that might be on a Linux system.
NVidiaFlash
Give four examples of ways an open source business model can profit.
Dual licensingMultiple productsBounties: users pay for desired featuresDonations
Give four examples of where Linux is found.
Server roomsCloud computingEmedded (Android, TiVo, GPS, etc)Airport signageMars roverAnd so much more!
What is a widget set?
A library which usually handles GUI features such as menus and icons.
What are the two most common widget sets?
GTK+ and QT
What is the KDE Desktop Environment
K Desktop Enbironment.Default DE in Mandriva and Suse Linux.Built using the QT Widget set.
What is the GNOME Desktop Environment?
Default DE for RedHat, CentOS, Fedora, Debian and more.Built on top of the Gimp Tool Kit (GTK+) widget set.
What is the XFCE Desktop Environment?
Originally modelled as a commercial DE.Provides more customization than GNOME or KDE.Built using GTK+.Originally known as CDE.Aims to use little resources.Can be found in Xubuntu and Debian.
What does BASH stand for and what does it do.
Born Again Shell.BASH is a shell, that offers a command line.
Define Virtualization.
The creation of a virtual operating system through a virtualization software that is known as the hypervisor.
Give four examples of virtualization software.
Virtual box (open source)VMWareKVM/QEMUXEN
What is a shell?
A command line interperter.
How would you long list out the contents of a directory and show hidden files?
ls -al
What does the pwd command do and what does it stand for?
Prints the working directory, literally stands for print working directory.
Where are commands in the Linux file system run from?
Commands in Linux are not truly run from the current working directory. They are run from path environment variables.
True or false: Command and directories are case sensitive.
True.
What is the command to print the environmental variables on the current user?
env
What does the top command do?
Lists processes and applications.
What does the which command do?
Lists where an application lives.
What is a command to print out the current logged in user?
whoami
What does the netstat command do?
Displays current status of the network.
What does the ifconfig command do?
Show network interface cards (NIC) configurations that are set.
What does the ip addr command do?
Show network interface cards (nic), configurations that are set.On newer linux distros, similar to ifconfig.
What does the uname command do?
Displays operating system information.
What does the .bash_history file do and where is it?
Stores command line history and it is a hidden file located in the users home directory.
Using the command line, what does tab do?
Automatic command completion and or suggestion.
Using the cd command how would you go up one directory?
cd..
What does the cd command do?
Changes directory.
What run level is the GUI environment?
Run level 5.
Where are command aliases stored?
etc/bashrc
What bash profile file would you edit for all users?
etc/profile.c
What is stored in the .bash_logout file?
Logout prefernces
What user specific bash profile file stores user preferences?
.bash_profile or .profile depending on distro
What is .bashrc?
Non login shell that stores user specifications and aliases
What are environmental variables?
Set of variables any program can acces
What symbol and or key on the keyboard switches to the home directory and represents the $HOME environmental variable?
”””~”” - The tilde”
How would you echo out the $HOME variable
echo $HOME
What is the default value of the BASH environmental variable?
/bin/bash
What is the default value of the SHELL environmental variable?
/bin/bash
What is the default value of the ENV environmental variable?
Distro specific. In CentOS it would be /etc/bash.bashrc
What does the EUID environmental variable represent?
The user id of the current user.
What does the DISPLAY environmental variable represent?
The local video card monitor
What is the PATH environmental variable?
Distro dependent, stores list of directories to be searched when running a command from the shell prompt
What does the LOGNAME environmental variable represent?
The username of the current user.
What does the MANP environmental variable represent?
Distro dependent, documentation/manual pages (man pages)
To what environmental variable would you add custom command to so that the Linux operating system can find them?
PATH,PATH=$PATH:/some/directory/here. Don’t forget the export command when doing this.
“What would the command ““export PATH”” do?”
Now all other users will have access to whatever program is in /some/directory/hereIn order to make this persistent across a reboot you have to edit .bash_profile
“True or false:””-“” and ““_”” can be used in variable names, do not use as first character though.”
True
What file would you edit to share a custom command (with the PATH variable) with all users?
/etc/profile
What is the PATH variable?
List of directories to search when running a command
Define globbing
global command - The process of expanding a non specific file name containing awildcard character into a set of specific file names that exist on storage, server or network
“Where does the term ““globbing”” come from?”
Comes from the etc glob program in Unix, that would expand on wildcard patterns. Later on this got built in to the shell.
Define wildcard.
“Placeholder that represents a character, ““*””, “”?”””
How would you list all files in a directory using a wildcard?
. or just *.txt for text files, etc..
How would you list all txt files that only had 1 character as their name?
ls ?.txt
“True or false: Youcan use multiple “”?””; for instance “”???”” “”?????”””
True
“How would you list all files starting with an ““F”” that have the txt extension?”
ls [F]*.txt
“How would you list all files that begin with ““f”” and have either ““i””, ““g”” or ““h”” as the second letter?”
ls f[igh]
Explain double quoting.
Double quote - substitutes the value of variables and commands.
Explain single quoting
Single quote - This preserves the literal meaning of each character of a given string, This will turn off the special meanings of all characters.
“Explain why you would use the backslash, “”"””
Backslash - this takes away, or removes the special meaning from a single character, can be used as an escape character.
“What is the back tick key used for, “”`””?”
”””`”” - The back tick key, used for command substitution”
“Explain the difference between command parameters prefixed with a “”-“” and command parameters without a leading “”-“””
“Parameters with a dash “”-“” are called optionsParameters with no leading dash are called arguments”
Explain the relationship between the command, the options and the arguments.
command - what to dooptions - how to do itarguments - what to do with it
The Linux MAN pages, what does MAN stand for?
The Manual Page System, or in short man pages.
List the manual sections from the MAN pages.
1.) Executable programs and shell commands2.) System calls provided by the kernel3.) Library calls provided by the program libraries4.) Device file (usually stored in /dev)5.) File formats6.) Games7.) Miscellaneous (macro packages, conventions, and so on)8.) System administration commands (programs run mostly or exclusively by root)9.) Kernel routines
Give three examples of how to use the man command in order to find help with a specific command.
man <keyword>man cp - copyman cal - calenderman passwd - passwordman 5 passwd - pull up specific file format information about passwd. Note the 5, as in section 5 of the MAN pages, or the file format section</keyword>
What does the whatis command do?
whatis - returns 1 line from each section for input keyword
Give an example of using the whatis command.
whatis passwd - will return 3 lines of information about the passwd command
What does the apropos command do?
apropos - command for a more thorough search through the MAN pages, returns everything that keyword is in
What does the man -k man do?
”"”man -k man”” will do the exact same thing as ““apropos man””. The -k stands for keyword. This is a much more efficient way of searching.”
How are the man pages organized?
“MAN pages are organized as follows:- Name – Synopsis - How command is actually used and lists optional parameters that appear in square brackets. Could follow up optional commans with ““…”” (three periods). Which denotes an optional set of repeated elements such as multiple file names if a command takes 1 or more files names as options. Some commands provide multiple synopsis lines indicating that certain options are contingent on other options fist. Basically this is just a fancy way of saying multiple options and files can be used at the same time. If you see an option underlined, it means you must use it. Such as in the mv (move) command where you must specify the source and destinations file or directory.- Description - Summary of command, file or other action does- Options - Commonly referred to as flags. Expands on Synopsis section above. Explains what each of the options/flags will do.- Files - Will list files associated with the man pages subject. Configuration files for servers or other programs that could possibly be related to config files- See Also - Provides pointers for related material within the MAN system- Bugs – History – Author -“
True or false: Commands, filenames and command flags/options are case sensitive in Linux?
True
What text viewer does the MAN system use?
less
“True or false: Editing the ““PATH=”” in the .bash_profile or .profile would be at the specific user level.”
True
“In order to print out the dollar amount with the correct formatting what character would you add to the following command?echo ““The cheeseburger is going to cost you $5.00”””
“The “”"” escape character. echo ““The cheeseburger is going to cost you $5.00”””
What command is used to get the word count of a file?
wc
What is the ‘, or the back-tick, used for?
“Command substitution. Example:echo ““Did you know that there are ‘wc -w <testfile1.ext’ words in our textfile called textfile1.txt”””
“True or false: You can use “”"” to escape and type command on multiple lines”
True. Example:
ls \
-all
What are the two main features that seperate info pages from MAN pages?
Info Pages- Similar to MAN but the goal is to support functions in which MAN can not- Most notable are hyperlinks, MAN does not have hyperlinks- You can use Info Pages to read MAN pages
What are the info pages key commands?
Info Pages key commands:? - Displays help informationN - Moves to the next node in a linked series or levelP - Moves back in a series or levelU - Moves up one level in the node hierarchyArrow keys - moves the cursor around the screen to select linesPage up, Page down - Scroll up and down within single nodeEnter - Moves to a new node once you have selected itL - Displays the last info page you readT - Displays the top page for a topicQ - Exits from the info page system
Why do some programmers not support info pages?
Because they are resistant or slow to adopt new systems even though MAN has been around for decades and does not support new features.
Besides man pages, info pages and the internet what is another way to get help in Linux?
“Many Linux distro’s ship documentation as a seperate package from the actual package that is the program. These are typical named by ““-doc”” or ““-documentation”” in the package name.
Readme text files for unzipped source files are usually found in:
- /usr/doc/packagename
- /usr/share/doc/packagename
- /usr/share/doc/packages/packagename
”
Where are configuration files typically located?
In the /etc directory
In an RPM based distro, how would you use the RPM tool to locate documentation?
Example:rpm -ql packagename | grep docrpm -ql yum | grep README
How would you find specific keyword(s) within a directory?
“find /usr/share/doc -name ““passwd”””
True or false: the locate command is faster than the find command.
True.
The locate command is faster than find but not directory specific, searches database of programs that Linux maintains:
locate passwd
What does the updatedb command do?
Creates and or updates database of file names used by the locate command.
What does the whereis command do?
Searches standard directories where programs might be installed.Example:whereis passwd
True or false: The less utility can read most file formats.
True
Whe .1 - .9 file formats can be read by what programs?
man, info, less
The .gz or .bz2 file formats can be read by what programs?
gunzip, bunzip, less
The .txt file format can be read by what programs?
less and any text edit such as vi and vim
The .html and .htm file formats would be read with what program?
web browser
The .odt file format would be read with what program?
LibreOffice, OpenOffce, any word processor
The .pdf file format would be read with what program?
xpdf, Adobe Reader
The .tif, .png and .jpg file formats would be read with what program?
Gimp
What is the FHS?
File system Hierarchy Standard.
- The Linux file system uses a hierarchy structure to organize data
- Linux systems have a standard in which at the root directory has several of the same sub directories in a certain order or fashion
- Root folder is the top level directory
Give an example of the FHS on the command line.
“[user@computer1 /]$ - the “”/”” means we are at the top level directory”
Considering the FHS, under the root directory what are some common directories?
bin - contains binaries, or executable files, necessary to run the Linux file systemboot - contains boot loader files to boot Linux systemdev - contains special files used to represent various hardware devices which could be installed on systemetc - contains text based configuration files
Under /etc what are some common configuration directories?
/etc/aliases - Contains a table used to redirect all to local users/etc/exports - Configured file systems to be exported to remove NFS clients/etc/fstab - Lists the partitions and file systems that will be automatically mounted when we boot our Linux system/etc/ftpusers - Controls users access to FTP service running on a Linux system/etc/group - Contains local group definitions/etc/grub.conf - Contains configuration parameters for the init process/etc/hosts - Contains a list of hostname to IP address mappings for resolving certain hostnames, ie: localhost too 127.0.0.1/etc/inittab - Contains configuration parameters for the init process/etc/init.d - Sub directory that contains startup scripts and services/etc/rc.d/init.d - Red Hat or CentOS based systems startup scripts/etc/passwd - Linux systems users accounts file/etc/shadow - Contains encrypted passwords for user accounts/etc/resolv.conf - This is where we specify what DNS server and domain suffix that our system is going to use/etc/X11 - X windows configuration files
What does the home directory contain?
The home directories of all users on the system
What does the /lib directory contain?
Contains code libraries for programs to use that live with the bin or sbin folders
What does the /media directory contain?
Used by some distros to mount external devices such as external hard drives and USB thumb drives
What does the /mnt directory contain?
Used by some distros to mount external devices such as CD drives, DVD drives, USB drives and so on
What does the /opt directory contain?
Contains files for some programs that you can install on your own manually