Using Linux - Large Text Files

From Computer Science
Revision as of 14:06, 13 August 2019 by Jkinne (talk | contribs)
Jump to: navigation, search

This page is a part of the Linux and CS Systems Bootcamp

In this section we walk you through looking at a text file that contains the complete works of Shakespeare (courtesy of Project Gutenberg).

First, login to the system and open up the terminal. Next, make sure you are in your home directory and create a directory to use for this example.

cs299@cs:~> cd ~
cs299@cs:~> mkdir shakespeare
cs299@cs:~> cd shakespeare

Copy the text file from where it is stored on the CS server and use the wc command to see how many lines, words, and characters (bytes) are in the file.

cs299@cs:~/shakespeare> cp /u1/junk/shakespeare.txt .
cs299@cs:~/shakespeare> ls
shakespeare.txt
cs299@cs:~/shakespeare> wc shakespeare.txt 
 124787  904061 5589890 shakespeare.txt

You can also use the nano text editor (or whatever text editor you like) to look through the text file.

nano shakespeare.txt