Piping Flashcards
Piping
directing one command one commands output into another command input.
how would you take the date command and insert it into a txt document called date.txt
date >date.txt
what is a delimiter
A delimiter is a sequence of one or more characters for specifying the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.
how would you get just the day of the week using the date,pipe, and cut.
date | cut –delimiter “ “ –fields 1
what are sections of data which are broken up by delimiters
fields
what is processed first? redirections or pipes?
think of it like PEMDAS.
redirection
tee command function
sends standard output to two independent destinations [ex. standardin, file.txt]
cut the date command IOT show day of week on terminal. Show full date in separate folder labeled fulldate.txt
date | tee fulldate.txt | cut –delimiter “ “ –fields 1
cut the date command IOT show day of week in today.txt. append full date in separate folder labeled today.txt
redirection stops piping
can you pipe a standard output after redirecting it?
no
cut the date command IOT show day of week in today.txt. append full date in separate folder labeled today.txt. take snapshot of data after cut performs function.
date | tee fulldate.txt | cut –delimiter “ “ –field 1 | tee postcut.txt |»_space;today.txt