home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 51.10 The date Command Chapter 51
Miscellaneous Useful Programs and Curiosities
Next: 51.12 You Don't Have Enough Smileys?
 

51.11 Making an Arbitrary-Size File for Testing

The yes command ( 23.4 ) outputs text over and over. If you need a file of some size for testing, make it with yes and head ( 25.20 ) . For example, to make a file 100k (102,400) characters long, with 12,800 8-character lines (7 digits and a newline), type:

% 

yes 1234567 | head -12800 > 100k-file

NOTE: On some UNIX systems, that command may "hang" and need to be killed with CTRL-c - because head keeps reading input from the pipe. If it hangs on your system, replace head -12800 with sed 12800q .

- JIK , JP


Previous: 51.10 The date Command UNIX Power Tools Next: 51.12 You Don't Have Enough Smileys?
51.10 The date Command Book Index 51.12 You Don't Have Enough Smileys?

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System