Module 1- Introduction to Operating Systems and Becoming a Power User Flashcards
Learn basic commands, file and text manipulation
Absolute path
Example:
Windows- cd C:\Users\cindy\Documents
Linux: cd/home/cindy/documents
It is one that starts from the main directory
Alias
A nickname for common commands
Appending flags
> >
A way to add the data of the file without erasing existing data
Bash
The language used to interact with the shell
CLI
Command line interpreter
Command line
A text interface program for a computer that inputs text commands and translates them to the operating system
Escape characters
A concept that means that the next character after the back tick should be treated literally
.exe
A file extension found in Windows for an executable file
Groups
A collection of users
GUI
A graphical user interface
Hidden files
A set of files that are not visible either to avoid alteration or simply because you don’t want someone to see them
Hot key
Example:
Ctrl-C (copy)
Ctrl-V (paste)
A keyboard shortcut that does a particular task
I/O Streams
An input stream handles data flowing into and out of a program
Parameter
A value that is associated with a command
Parent directory & child directories
A parent directory is a directory that houses all subsequent child directories
Paths
Path example
Windows: C:\User\CIndy\Desktop
Linux /home/cindy/desktop
A main directory that branches off and holds other directories and files
Prompt
A prompt shows you which directory you’re currently in
Relative path
Example:
WIndows- cd…pwd
Linux- cd../documents
It is a path from your current directory
Regular expression
A pattern matching language that describes words, phrases, or more complicated patterns; regular expressions are used to help you do advanced pattern based selection
Root directory
A parent directory for all other directories in a file system
Shell
A shell is a command line interpreter for Linux
Standard error (stderr)
A data stream that redirect the output of error messages in a different output stream. It works both in Linux and Windows
Standard In (stdin)
A data stream in which the input that you provide through the keyboard goes to the standard in stream of the process that you’re interacting with. It works both in Linux and Windows
Standard out (stdout)
A data stream that when a process creates output, it adds data to the standard out stream, which flows out of the process. It works both in Linux and Windows
Stdin, stdout, stderr
Three data streams created when you launch a Linux command
Subdirectories
A directory below or at a deeper level in the directory hierarchy
Tab completion
A way to auto-complete a command or file names and directories
Wildcard
A character that is used to help select files based on a certain pattern
Windows Search service
A service that indexes files on your computer by looking through them on a schedule
cd in the CLI
or change directory commandIf we want to change the directory that we’re in
pwd in the CLI
or print working directorytells you which directory you’re currently in.
Command Line Interfaces on Windows
cmd.exe
powershell.exe
Command to list directories in CLI
ls C:\
Command to list directories in Linux
ls/
CLI Command that will…
This will give us a brief summary of the command’s parameters.
Get-Help ls
Linux Command that will…
view what options are available for a command by adding the help flag
ls–help
What is the CLI Commnad?
Now you can see a description of each of the parameters and some examples of how to use the command.
Get-Help ls -Full
What is the Linux Command?
to get information about commands is the _______ command for manual. It’s used to show us manual pages
man—help
CLI
parameter will show hidden and system files that aren’t normally listed with just ls
Ls -Force C:\
CLI command
Want to get to the desktop directory in your home folder.
Cd~\Desktop
Bash command
In Bash, the ____ is used to referenceour home directory., so ______ will take us back to our desktop.
cd ~/desktop
Tab completion in Bash vs Windows
The difference between Bashtab complete and Windows tab complete is that if we have multiple options, it won’t rotate through the options, but instead will show us all options at once.
Tab completion in Windows
lets us use the tab key to auto complete file names and directories.Example: type D then tab
mkdir
make directory.
Ctrl-R
search through your previously used commands using the history shortcut
clear command
This doesn’t wipe your history, it just clears the output on your screen.
power shell command to copy something
CP
CLI
(-Recurse)
To copy over the contents of the directory,you need to use another command parameter
CLI
(-Verbose)
Copy doesn’t output anything to the CLI by default unless there are errors.When we use copy-Verbose, it’ll output one line foreach file the directory being copied.
mv
mv or move can rename andmove files and directories
rm
remove files. Once removed, gone for good. Typically power given only to authorized user.
More Command in power shell
more
“to view contents of the file 1 page at a time. The more command will get the contents of the file, but will pause once it fills the terminal window. Now we can advance the texts at our own pace. “
More Command in Bash
slowly going out in favor of the less command.
Cat Command in Power shell
cat
this will dump the contents of the file in our shell. This isn’t the best solution for a file, since it just keeps writing the content until the whole file is displayed
Cat Command in Bash
The Cat command is similar to the Windows Cat command since it doesn’t do a great job at viewing large files
Enter Key in Power shell
The Enter key advances the file by one line. You can use this if you want to move slowly through the file.
Space Key in Powershell
Space advances the file by one page.
Q Key in Powershell
The Q key allows you to quit out of more and go back to your shell. If we want to leave the more command and go back to our shell, we can just hit the q key.
(-HEAD)
We don’t really want to open up the whole file. Instead, we just want to get a glimpse of what the document is. This is called the head of the file. This example command will show the first 10 lines of a file.
(-Tail)
example to view the last 10 lines of a file.
Less command in Bash
Less does a similar thing that more does for Windows but it has more functionality. Less command launches you into an interactive shell. Used frequently as IT support specialist.
g command in Bash
lowercase g this moves to the begininng of a file.
G command in Bash
Capital G moves to the end of a file.
Command in Bash allows you to search for a word or phrase.
/word_search
q command in Bash
allows you to quit out of less and go back to your shell
NANO in Bash
launches you into the nano program to start editing
CONTROL G in Bash
which helps open up a page
CONTROL X in Bash
which is used when you want to save your work or exit from nano
Notepad++ editor in Windows GUI that can…
can open multiple files and tabs. opensource text editor, support for different file types.
Syntax Highlighting
displays text in different fonts and colors to help highlight things
Power Shell Commands
Get-Allias ls
Get-ChildItem
Get-ChildItem C:\
What does each command mean…
to see the actual powershell command that gets executed. When we use this command we are actually calling Get-ChildItem
gets or lists the children which are the files and subdirectories of the given item.
it’s the same as ls C:\
powershell commands are very long and descriptive which makes them easy to understand. But it does mean a lot of extra typing when your working at the cli
Windows searching within files… Command to search for the word.
Ctrl-F
USING NOTEPAD++
to open the find in files dialog
CTRL+SHIFT+F
SEARCH WORDS FROM WITIN COMMAND LINE
select desk string command to find words or other strings of characters and files.
sls
(-Filter)
The -Filter parameter will filter the results for file names that match a pattern.
*
The asterisks mean match anything, and the .exe is the file extension for executable files in Windows. So the only results we’re going to get are the files that end in .exe, cool.
ECHO COMMAND IS AN ALLIAS FOR
ECHO COMMAND IS AN ALLIAS FOR Write- Output
We know the echo command prints out our keyboard input to the screen. But how does this work? Every Windows process and every PowerShell command can take input and can produce output.
Windows
GREATER THAN SYMPOL >
The greater than symbol is something we call a redirect or operator that lets us change where we want our standard output to go.
Windows
2>
When we use two greater than, we’re telling PowerShell to redirect the standard error stream to the file instead of standard out.
Null Command
$null
What if we don’t care about the error messages, but we don’t want to put them in a file? Using our newly learned redirect or operators, we can actually filter out these error messages. In PowerShell, we can do this by redirecting standard error to dollar sign null.