Globbing, Quoting and Searching Flashcards
How do you match zero or more characters?
*
i.e ls sc*
How do you match a specified number of characters?
?
i.e ls tr??
How do you match specified characters?
[]
i.e ls [SsLlPp]ink
How do you match specified numbers?
[1-9]
i. e ls script[1]
i. e ls script[2-7]
How do you omit characters when matching?
[^]
i.e ls [^Ioa]oft
How do you echo a variable within quotes?
””
i.e echo “$PATH”
How do you echo a string containing a dollar sign?
’’ or \
i. e echo ‘$3.50’
i. e echo “$3.50”
How do you list a file/directory containing spaces?
’’ or “” or \
i.e mkdir Secret\ Space
How do you type a command extending to multiple lines?
\
i.e ls \
file1 \
file2
What character designates a root vs standard user at a terminal?
$ - standard user
# - root user
i.e [root@lukebakare1c ~]#
What is the command to search a database of files and directories for a matching name?
locate
i.e locate directory1
What is the command to search for a file/directory in a specific location?
find
i.e find /etc/ -name ‘yum*’
How do you search for the location of a command?
whereis
i. e whereis grep
* locates binary, source files and manual pages
How do you lookup what a command does?
whatis
man -f
i.e whatis yes
*searched man pages for a command (1-9)
How do you lookup the documentation for a command?
man
i.e man test