Beginner Linux Flashcards
Who developed UNIX?
Ken Thompson and Dennis Ritchie of Bell Laboratories
It was later rewritten in C to make it more portable.
Who created GNU?
Richard Stallman
“GNU’s Not Unix”
What is the GPL?
The GNU General Public License. A free software license
The most important piece in the operating system
The kernel
What is the primary job of the kernel?
It allows the hardware to talk to the software
Who developed the Linux kernel?
Linux Torvalds
What year was the Linux kernel developed?
1991
What is GNU known for?
The Free Software Movement. A campaigns to win for the users of computing the freedom to run, copy, distribute, study, change and improve free software.
What does the term Linux actually refer to?
The Linux kernel
Why are distributions referred to as “Linux operating systems”?
Because they use the Linux kernel
A Linux system is divided into what three main parts?
- Hardware
- Linux kernel
- User space
What are the most popular Linux distributions?
Debian Red Hat Enterprise Linux Ubuntu Fedora Linux Mint Gentoo Arch Linux
A distribution used mostly as an enterprise server OS
Red Hat Enterprise Linux (RHEL)
A Debian-based operating system developed by Canonical.
Ubuntu - One of the most popular Linux distributions for personal machines
An upstream RHEL operating system
Fedora - RHEL gets updates from Fedora after thorough testing and quality assurance
A distribution based off of Ubuntu
Linux Mint
A flexible OS made for advanced users
Gentoo
A lightweight and flexible Linux distribution driven 100% by the community
Arch Linux
Created by a community that promotes the use of Linux everywhere, working together in an open, transparent and friendly manner as part of the worldwide Free and Open Source Software community
openSUSE
A program that takes your commands from the keyboard and sends them to the operating system to perform
The shell
Almost all Linux distributions will default to what shell?
bash (Bourne Again shell)
Common shells
bash, bourne, korn, ksh, zsh, tsch
What is everything in Linux?
Everything in Linux is a file
How is every file organized in Linux?
In a hierarchical directory tree
The first directory in the file system is aptly named?
The root directory
The location of files and directories are referred to as?
paths
How to print working directory showing you which directory you are in with a path from root?
pwd
What command let’s you move around the filesystem?
cd (change directory)
What are the two ways to specify a path?
- Absolute path
2. Relative path
The path from the root directory
Absolute path
The path from where you are currently in filesystem
Relative path
The root directory is commonly shown as what?
A slash /
Shortcut to the directory you are currently in
A single period .
Shortcut to the parent directory
A double period ..
Shortcut to the user’s home directory
A tilde ~
Shortcut to the previous directory
A hyphen -
Command to list directory contents and show you detailed information about the files and directories you are looking at
ls
Not all files in a directory will be visible. Filenames that start with what are hidden?
How Filenames that start with a period . are hidden
How do you view hidden files?
Using the -a flag on the ls command (a for all)
$ ls -a
This flag on the ls command will show you detailed information
$ ls -l
What does the Touch command do?
Touch allows you to create new empty files.
Touch is also used to change timestamps on existing files and directories
What does the file command do?
It’s used to find out what kind of file a file is
A simple command to display file contents but it can also combine multiple files and show you the output of them.
cat command, short for concatenate
It’s only meant for short content
Displays text in a paged manner, so you can navigate through a larger text file page by page
less command
There are commands to navigate through less e.g. page up and down, q to quit, g and G to move to the beginning and end of the file
Lists the history of the commands that you previously entered
history
How to run the same command you did before
Press the up arrow
What does !! do?
Runs the previous command without typing it again
How to use the reverse search command?
ctrl-R and start typing parts of the command you want and it will show you matches and you can just navigate through them by hitting the ctrl-R key again
How to clear up your display
clear command
If you start typing the beginning of a command, file, directory, etc and hit the Tab key what happens?
will autocomplete based on what it finds in the directory you are searching
A character that can be substituted for a pattern based selection, giving you more flexibility with searches
A wildcard
Copy files
cp
Wildcard used to represent all single characters or any string
*
Wildcard used to represent one character
?
Wildcard used to represent a character from a group
[ ]
How to recursively copy the files and directories within a directory?
With the recursive flag and the cp command
$ cp -r
How can you ensure that a file you are copying isn’t accidentally overwritten with a file of the same name?
With the interactive flag to prompt you before overwriting a file
$ cp -i
Used for moving files and also renaming them
mv
What does the -b flag do when used with the mv command?
$ mv -b directory1 directory2
It will make a backup of that file and it will rename the old version with a ~
What does mkdir do?
Make Directory
How can you create directories and subdirectories at the same time?
WIth the -p parent flag
$ mkdir -p directory/subdirectory
The command that is used to delete files and directories.
rm
Does Linux have a trash can that you can fish out removed files?
No
What are some safety measures to prevent files from accidental deletion?
Write-protected files will prompt you for confirmation before deleting them
What flag tells rm to remove all files, whether they are write protected or not, without prompting the user?
The -f or force flag
$ rm -f file1
What rm flag will give you a prompt on whether you want to actually remove the files or directories?
The -i interactive flag
$ rm -i file1
How can you remove a directory and remove all the files and any subdirectories it may have?
With the -r recursive flag
$ rm -r directory1
How can you remove an empty directory?
With the rmdir command
$ rmdir directory
A command that allows you to specify a directory to search, and what you’re searching for
The find command
$ find /home -name pic.jpg
$ find /home -type d -name MyFolder
type -d is for directory
A built-in bash command that provides help for other bash commands (echo, logout, pwd, etc)
help
$ help echo
For executable programs, it’s a convention to have a help option
–help
$ echo –help
How to view the manuals for a command?
man for the man pages
$ man ls
What if you are ever feeling doubtful about what a command does?
Use the whatis command
$ whatis ls