• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/117

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

117 Cards in this Set

  • Front
  • Back
Directory
Used to organize other files into a logical tree structure
Absolute pathname
The pathname from the root directory up to a certain specified file or directory
Root
The top of the tree structure (different usage of word than the user root)
Windows filesystem structure vs linux filesystem structure
Windows is organized by drive letters which limits you to only save things on whatever drives are accessible. Linux starts off at root and everything is available from 1 to 2 directories down.
Home directory
Unique to each user
pwd
Print working directory command - it displays the current directory/working directory in the directory tree
cd
Change directory command - changes the current directory in the directory tree
Relative pathname
pathname of file or directory relative to the current directory
Subdirectory
Directory residing within another directory
Tab-completion
Pressing the tab key fills in remaining characters of a unique filename or directory name (??). Is a BASH shell feature.
Text files
Plain text characters, that is, standard keyboard characters
Binary files
Non-plain text files containing:
BINARY DATA FILES - data files with special fomatting e.g graphic files, and...
BINARY PROGRAM FILES - executable version of a program, that is, in machine language
Directory files
Used to organize files
Linked files
a file that points to another file
Special device files
Represent system devices
Named pipes
Identify channels that pass information between processes
Socket files
Allows a process on another computer to write to a local file
Filename
Identifier given to a file
Filename extensions
Identifiers following a dot (.) at the end of the filename. It denotes file type, although most linux files dont have extensions
types of filenames 1
.c - C programming language source code files, .cc or .cpp - C++ programming language source code files, .html or .htm - hypertext markup language files, .ps - files formatted for printing with post script, .txt - text files, .tar - archived files like zip on windows, .gz or .bz2 or .Z - compressed files, .tar.gz or .tgz, or .tar.bz2 or .tar.Z - compressed archived files, .conf or .cfg - configuration files, .so - shared object (prog. language) files, .o - compiled object files
types of filenames 2
.pl - PERL programs, .tcl - Tcl (Tool command language) programs, .jpg or .jpeg or .png or .tiff or .xpm or .gif - binary files that contain graphical images, .sh - shell scripts (contains text that is executed by the Shell)
ls
lists the files in a directory. May pass argument indicating directory to be listed.
ls -f
ls argument to list file types (file types shown in color as wel)
ls -l
argument to display a long file listing
ll
is the alias for ls -l.
file
command that displays the file type of any file
Hidden files
Files not normally displayed to the user. Start in command with a dot when naming file. These are often the configuration files of the computer that are hidden.
ls -a
Displays all files including hidden files
ls -A or ls --almost-all
lists most filenames (excluding the . and .. special files)
ls -C
lists filenames in column format
ls --color=n
lists filenames w/o color
ls -d or ls --directory
lists directory nanes instead of their contents
ls -f
lists all filenames w/o sorting
ls -F or ls --classify
lists filenames classified byn file type
ls --full-time
lists filenames in long format and displays the full modification time
ls -l
lists filenames in long format
ls -lh or ls -l or ls --human-readable
lists filenames in long format with human readable (easy-to-read) file sizes
ls -1G or ls =1 or ls --no-group or ls -o
lists filenames in long format but omits the group info
ls -r or ls -reverse
lists filenames reversely sorted
ls -R or ls --recursive
lists filenames in the specified directory and all subdirectories
ls -s
lists filenames and their associated size in kb
ls -S
lists filenames sorted by filesize
ls -t
lists filenames sorted by modification time
ls -U
lists filenames without sorting
ls -x
lists filenames in rows rather than in columns
Wildcard Metacharacter
Used to simplify commands specifying multiple filenames. Can be used with most linux filesystem commands.
Wildcard Metacharacter Examples:
* = matches 0 or more characters in a filename... ? = matches 1 character in a filename... [aegh] = matches 1 char in a filename - provided this char. is either an a,e,g or h... [a-e] - matches 1 char in a filename provided this char is either an a,b,c,d or e. [!a-e] matches 1 char in a filename provided this char is NOT an a,b,c,d or e.
Concatenation
Joining text together
cat
Command that displays (concatenates) contents of a text file to the screen. With option: -n that displays the line number and contents.
Log files
Contains records of past system events. The newest events are appended to the end.
tac
A command that displays text files in reverse order
head
Command to view first few lines of a file / preview. ALSO: Can specify what line # to start at... ex: head -5 filenamehere
tail
Command to view the last few lines of a file / preview. ALSO: Can specify what line # to start at... ex: tail -5 file1
more
Command that displays text files screen by screen. Space key goes to next page, Enter key goes to next line. Can be used with output of other commands.
less
Same as the 'More' comanbd, but can also use the cursor as well as PgUp and PgDwn to scroll. Can be used with output of other commands.
"|" metacharacter
Use if output is too large to fit on terminal screen.. is the pipe metacharacter, which uses the output of the previous command as the input for the following command (??)
strings
Command that searches for and displays text characters in a binary file. Will sometimes indicate the purpose of a binary file.
To display correctly the contents of binary files..
you'll typically want to use the program that originally created the file
od
Command that displays the contents of a file in octal format.
Octal Format
Numeric base 8 format for file display
od -x
Changes display from Octal to Hexadecimal format
Hexadecimal Format
Numeric base 16 format for file display
Text Tools
A tool to search for and manipulate text
Regular expressions (regexp)
Text wildcards that assist a search for specific text. It matches with text patterns.
Regular expressions vs Wildcard metacharacters
Metacharacters interpreted by the Shell; reg. expressions are interpreted by text tools. Metacharacters match characters in filenames - reg. expressions match chars within text files. There are more reg. exp. than wildcard metachar.
Reg. Expressions Ex:
* = matches 0 or more occurrences of the previous character, ? = matches 0 or 1 occurences of the previous character, + = matches 1 or more occurences of the previous character, . = matches 1 char. of any type, [...] = matches one char. from the numeric range specified within the braces, [^...] = matches one char. NOT from the range specified within the braces.
Reg. Expressions Ex 2:
{} = matches a specific number or range of the previous character, ^ = matches the following characters if they are the first characters on the line, $ = matches the previous characters if they are the last chars on the line, (. . . | . . . ) = matches either of two sets of chars.
grep
A command that displays lines in a text file matching a given regular expression... Requires 2 arguments: search string and files to search... which would be displayed as:
grep -v
Reverses meaning of previous command
grep -i
Case insensitive search
Vim
One of the oldest and most popular text editors for UNIX OS's... standard on most linux distributions... arvantage is portability (not usability)
Bi-modal Editor in Vim
Two possible modes for the program... Command Mode: performing text editing tasks not related to inserting text, and Insert Mode: inserting text, but nothing else
vi
Command to open Vim. Use vi filename to open file, or just vi to launch without opening a file right away.
the vi editor
i = changes to insert mode and places the cursor before the current character for entering text, a = changes to insert mode and places the cursor after the current character for entering text, o = changes to insert mode and opens a new line underneath the current line for entering text, l = changes to insert mode and places the cursor at the beginning of the current linie for entering text, A = changes to insert mode and places the cursor at the end of the current line for entering text, O = changes to insert mode and opens a new line above the current line for entering text, Esc = changes back to command mode while in insert mode.
More Vim editor commands
Look on table 4-6 for moving the cursor
vi: w,, W, e, E
Moves cursor forward one word
vi: b, B
Moves cursor back one word
vi: 53G
Moves cursor to line 53
vi:G
Moves cursor to last line in doc
vi:0,
Moves cursor to beginning of the line
vi:$
Moves cursor to end of line
vi:x
Deletes the character the cursor is on
vi:3x
Deletes three chars starting from the char the cursor is on
vi:dw
Deletes one word starting from the char the cursor is on
vi:d3w,3dw
Deletes 3 words starting from the char the cursor is on
vi:dd
Deletes one whole line starting from the line the cursor is on
vi:d3d,3dd
Deletes three whole lines starting from the line the cursor is on
vi:d$
Deletes from the cursor char to the end of the current line
vi:d, d0
Deletes from the cursor character to the beginning of the current line
vi:yw
Copies one word (starting from the char the cursor is on) into a temp buffer in memory for later use
vi:y3w,3yw
Copies three words (starting from the char the cursor is on) into a temp buffer in memory for later use
vi:yy
Copies the current line into a temporary buffer in memory for later use
vi:y3y,3yy
Copies 3 lines (starting from the current line) into a temporary buffer in memory for later use
vi:y$
Copies the current line from the cursor to the end of the line into a temporary buffer in memory for later use
vi:y,y0
Copies the current line from the cursor to the beginning of the line into a temporary buffer in memory for later use
vi:p
Pastes the contents of the temp memory buffer underneath the current line
vi:P
Pastes the contents of the temporary memory buffer above the current line
vi:J
Joins the line underneath the current line to the current line
vi:[Ctrl]-g
Display current line statistics
vi:u
Undoes the last function (undo)
vi:'.' (period)
Repeats the last function. (repeat)
vi:/pattern
Searches for the first occurrence of pattern in the forward direction
vi:?pattern
Searches for the first occurrence of pattern in the reverse direction
vi:n
Repeats the previous search in the forward direction
vi:N
Repeats the previous search in the reverse direction
vi:':q'
Quits from the vi editor if no changes were made
vi:':q!'
Quits from the vi editor and does not save any changes
vi:':wq'
Saves any changes to the file and quits from the vi editor
vi:':w filename'
Saves the current document to a file called filename.
vi:':!date'
Reads the output of the DATE command into the document under the current line.
vi:':r filename'
Reads the contents of the text file called filename into the document under the current line
vi:':set all'
Displays all vi environment settings
vi:':set'
Sets a vi environment setting to a certain value
vi:':s/the/THE/g'
Searches for the regular expression 'the' and replaces each occurrence globally throughout the current line with the word "THE"
vi:':1,$ s/the/THE/g'
Searches for the regular expression 'the' and replaces each occurrence globally from line 1 to the end of the doc with the word "THE"
nano
An easy to use common linux text editor with on screen command definitions
Graphical Text Editors
gedit editor: distributed with GNOME environment and kwrite editor: distributed with the KDE environment