3-222
TAC Commands
A Linux command that displays a file on the screen, beginning with the last line of the file and ending with the first line of the file.
Head command
A Linux command that displays the first set of lines of a text file; by default, the __ displays the first 10 lines
grep command
A Linux command that searches files for patterns of characters using regular expression metacharacters. The command name is short for "global regular expression print."
cd (change directory) command
A Linux command used to change the current directory in the directory tree.
cat command
A Linux command used to display (or concatenate) the entire contents of a text file to the screen.
more command
A Linux command used to display a text file page by page and line by line on the terminal screen.
Tail command
A Linux command used to display lines of text at the end of a file; by default, the __ displays the last 10 lines of the file
pwd (print working directory) command
A Linux command used to display the current directory in the directory tree.
home directory
A directory on the filesystem set aside for users to store personal files and information.he root user, however, has a __ called root under the root directory of the system (/root)
subdirectory
A directory that resides within another directory in the directory tree.
Tab-completion feature
A feature of the BASH shell that fills in the remaining characters of a unique filename or directory name when the user presses the Tab key.
Executable Program
A file that can be executed by the Linux operating system to run in memory as a process and perform a useful function.
Binary data files
A file that contains machine language (binary 1s and 0s) and stores information (such as common functions and graphics) used by binary compiled programs.
log files
A file that contains past system evens. Contains the most recent entries at the bottom of the file.
text file
A file that stores information in a readable text format.
Special device files
A file used to identify hardware devices such as hard disks and serial ports.
Socket file
A named pipe connecting processes on two different computers; it can also be represented by a file on the filesystem.
Emacs (Editor MACroS) editor
A popular and widespread text editor more conducive to word processing than vi. It was originally developed by Richard Stallman.
vi editor
A powerful command-line text editor available on most UNIX and Linux systems. Also called the bimodal editor because it functions in command mode and insert mode
Filename extensions
A series of identifiers following a dot ( . ) at the end of a filename, used to denote the type of the file; the filename extention .txt denotes a text file.
~ metacharacter
A shell metacharacter used to represent a user's home directory.
Directory
A special file on the filesystem used to organize other files into a logical tree structure.
Named pipe files
A temporary connection that sends information from one command or process in memory to another; it can also be represented by a file on the filesystem.
fgrep command
A variant of the grep command that does not allow the use of regular expressions.
egrep command
A variant of the grep command, used to search files for patterns using extended regular expressions.
:
After you are in command mode, to save the text in a file called samplefile in the current directory, you need to press the__ character (
ll command
An alias for the ls -l command; it gives a long file listing.
od command
Another command that is safe to use on binary files and text files is the od command, which displays the contents of the file in octal format (numeric base 8 format).
ls command/file command
Because these files are rarely edited by the user and can clutter up the listing of files, they are normally hidden from view when using the __
emacs
Due to __ not being installed by default on Fedora, you can run the command yum install __ to obtain this text editor from a free software repository on the internet.
*
Executable file
Hidden files
Filenames that begin with a period are referred to as __
Filenames
Files are recognized by their __.. Can include up to 255 characters, yet are rarely longer than 20 characters on most Linux systems.
strings /bin/echo |more
For example, to find the text characters inside the /bin/echo binary executable program page by page, you could use the
Head command
If the file displayed is very large and you only want to view the first few lines of it, what command can you use?
vi editor
In addition, the _ regular expressions and can perform over 1000 different functions for the user and has the advantage of portability
Cat command
In order to display the line number of each line in the file in addition to the contents by passing the -n option to the __
tilde ~ character
In the VI editor, this character is on the left to indicate the end of a file.
-i option
Keep in mind that the text being searched is case sensitive; to perform a case-insensitive search, use the __ to the grep command:
Logical Directory Tree
Linus uses a __ to organize files into different directories/folders.
-a / --all options
List all filenames
-f option
List all filenames without sorting
-d / --directory option
List directory names instead of their contents
-s option
List filenames and their associated sizes in kilobytes (KB)
-F/ --classify option
List filenames classified by file type
-c options
List filenames in column format
-l option
List filenames in long format
--full-time option
List filenames in long format and displays the full modification time
-lG / -l --no-group/ -o option
List filenames in long format but omits the group information
-lh /-l --human-readable
List filenames in long format with human-readable (easy to read ) file sizes
-x option
List filenames in rows rather than columns.
-R / --recursive option
List filenames in the specified directory and all sub directories
-r / --reverse option
List filenames reverse sorted
-s option
List filenames sorted by file size
-t option
List filenames sorted by modification time
--color=n options
List filenames without color
-u option
List filenames without sorting
--A / --almost-all options
List most filenames (excludes the . and .. special files)
? Regular Expression
Matches 0 or 1 occurrences of the previous character
* Metacharacter
Matches 0 or more characters in a file name
[!a-g] metacharacter
Matches 1 character NOT given in a filename
[a-g] metacharacter
Matches 1 character given in a filename
[aegh] metacharacter
Matches 1 character given in a filename
? Metacharacter
Matches 1 character in a filename
. (period) Regular Expression
Matches 1 character of any type
+ Regular Expression
Matches 1 or more occurrences of the previous character
(... | ...) regular expression
Matches either of two sets of characters
[^...] Regular Expression
Matches one character NOT from the range specified within the braces
[...] Regular Expression
Matches one character from the range specified within the braces
$ regular expression
Matches the previous characters if they are the last characters on the line
command mode
One of the two modes in vi; it allows a user to perform any available text editing task that is not related to inserting text into the document.
Insert mode
One of the two modes in vi; it allows the user to insert text into the document but does not allow any other functionality.
-a option
Recall that filenames for hidden files start with a period character ( . ). To view them, simply pass the__ to the ls command
ls -F command
The __ appends a special character at the end of each filename displayed to indicate the type of file
ls command
The __ displays all the files in the current directory in columnar format; however, you can also pass an argument to the__ indicating the directory to be listed if the current directory listing is not required. In the following example, the files are listed underneath the /home/bob directory without changing the current directory.
parent directory
The directory that is one level closer to the root directory in the directory tree relative to your current directory.
Linked Files
The files that represent the same data as other files
absolute pathname
The full pathname to a certain file or directory, starting from the root directory.
concatenation
The joining of text together to make one larger whole. In Linux, words and strings of text are joined together to form a displayed file.
text tools
The major use of the UNIX operating system in the past 40 years involved simplifying business and scientific management through database applications. As a result, many commands (referred to as ___) were developed for the UNIX operating system that could search for and manipulate text, such as database information, in many different and advantageous ways
Wildcard Metacharacter
The metacharacters used to match certain characters in a file or directory name; they are often used to specify multiple files.
relative pathname
The pathname of a target directory relative to your current directory in the tree.
text tools
The programs that allow for the creation, modification, and searching of text files.
regular expressions (regexp)
The special metacharacters used to match patterns of text within text files; they are commonly used by text tool commands, including grep.
What happens when a destination directory is not issued as an argument when running the cd command?
The user gets sent back to your home directory
file command
To display the file type of any file, you can use the __ ; simply give the __ an argument specifying what file to analyze
vi filename (where file name specifies the file to be edited)
To open an existing text file for editing, you can type
parent directory
To refer to a directory one step closer to the root of the tree (also known as a __ ), simply use two dots (..).
-v option
To return the lines that do not contain the text "Algonquin Park," you can use the __ of the grep command to reverse the meaning of the previous command:
more/less commands
What commands are used to display larger text file in a page-by-page fashion?
Reverse order
When is it useful when displaying files that have have text appended to them continuously by system services?
dir command
Windows uses the __ to list files and directories; to simplify the learning of Linux for Windows users, there is a __ in Linux, which is simply a pointer or shortcut to the ls command.
regular expressions (grep)
__ A set of text wildcards was also developed to ease the searching of specific text information. These text wildcards are called __ and are recognized by several text tools and programming languages, including, but not limited to, the following: grep awk sed vi Emacs ex ed C++ PERL Tc
Wildcard metacharacters / regular expressions
__ are interpreted by the shell, whereas ___ are interpreted by text tools.
Wildcard metacharacters/ regular expressions
__ match characters in filenames (or directory names) on a Linux filesystem, whereas __ match characters within text files on a Linux filesystem.
regular expression (regex)/wildcards
__ metacharacters match characters in filenames (or directory names) on a Linux filesystem, whereas __ match characters within text files on a Linux filesystem.
myprogram file
a 32-bit executable complied program
ls -f command
a quick way of getting file type information in an easy to read format, at times you need to obtain more information about each files
Myscript file
a text file that contains executable commands (also known as a shell script)
ls -l command
can be used to provided a long listing for each file in a certain directory.
pg command
displayed a text file page by page on the terminal screen, starting at the beginning of the file; pressing the spacebar or Enter key displays the next page, and so on
head command
displays the first 10 lines (including blank lines) of a text file to the terminal screen but can also take a numeric option specifying a different number of lines to display.
more command
displays the next complete page of a text file if you press the space bar byt displays only the next line of a text file if you press enter
Linked Files
files that have an association with one another; they can represent the same data or they can point to another file (also known as a shortcut file)
file command
identify the differences between types of executable files
Special device files
less common than the other file types that have been mentioned, yet they are important for systems administrators because they represent different devices on the system, such as hard disks and serial ports. These files are used in conjunction with commands that manipulate devices on the system; __ are typically found only in the /dev directory
@
linked file
|
named pipe file
string command
searches for text characters in a binary file and outputs them to the screen. In many cases this text might indicate what the binary file is used.
=
socket file
/
subdirectory
Cd command
to change directories, issue the __ with an argument specifying a destination directory.
Filenames
typically composed of alphanumeric characters, the underscore ( _ ) character, the dash ( — ) character, and the period ( . ) character.