We can extract data about ATL to ORD flights.
First navigate to the Data Expo 2009 directory:
We can find all of the flights that departed from Atlanta
and arrived at O'Hare, and save them in a file:
grep ATL,ORD 2005.csv >AtlantaToChicago.txt
There are 8324 lines in the AtlantaToChicago.txt file.
We can tell this by checking the number of lines in this file,
using the wc command:
This gives the number of lines, words, and characters.
Since each line has no spaces, this means that it treats each line as a word,
only in this case. It is useful for other applications too.
If we only want to see the number of lines, we can use the -l flag:
wc -l AtlantaToChicago.txt
The last 10 lines that you typed are accessible from:
history | tail
If you want to temporarily make a directory and then remove it,
we can do that:
and then we can see that it exists:
and then we can throw it away:
Similarly, we can rename the AtlantaToChicago.txt file:
mv AtlantaToChicago.txt myfile.txt
or even make a copy:
cp myfile.txt backup.txt
and we can just throw one of these away:
but we still have the backup. Here are its contents: