Searching & Extracting Flashcards
What linux command is used to read an entire file?
less
*cat can only view a few lines
What linux command is used to read the beginning/end of a file?
head filetoread
tail filetoread
-n can be used to specify number of lines
What linux command is used to locate files on the system?
find
- type d/f to specify directory or file
- name
What linux command is used to search for text inside files?
grep charstofind fromlocation
What linux command is used to organise text in a file?
sort
- r reverse alphabetic order
- R random
What linux command is used to manipulate text by column?
cut
-c column i.e -c2-5 -c3-
-d delimiter -f field (used in conjunction)
> new file»_space; append to file
What linux command is used to word count a file?
wc
How do you use find and grep to select only specific matching text?
find | grep
What are regular expressions?
used to parse through text of certain arrangement
^ beginning of line
$end of line
. any single substituted character