Intro 3 Flashcards
When a path starts with /, it’s a ______.
full or absolute path
A path not beginning with / is a ______.
relative path
The shell can match simple patterns to file and directory names, a process known as _______.
globbing
Which shell glob character instructs the shell to match exactly one arbitrary character?
?
How can you escape globs?
surround the glob with single quotes
It is important to remember that the shell performs expansions _______ running commands.
before
Therefore if a * makes it to a command without expanding, the shell will do nothing more with it and it’s up to the command to decide what it wants to do.
What are two of the most important grep options?
case insensitive search (-i) and inverted search (-v) which prints all the lines that don’t match
How do you use the less command?
less filename
spacebar - pagedown
b - pageup
q - quit
The less command is an enhanced version of an older program named ____.
more
How can you search for text inside less?
To search forward for a word, type /word and to search backward, type ?word. Press n to go to the next match.
How can you keep grep search limits to one page at a time?
Pipe them to the less command
How can you see the difference between two text files?
diff textfile1 textfile2
What command can you use to see what kind of format a particular file is in?
file
Why do you need to escape glob characters when using find?
Because the shell will expand the wildcards itself before passing them to the find command otherwise.
What is the syntax of the find command?
find dir -name file -print