Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. Using Linux commands
  


echo and redirection page 13 of 15


Now, the same echo command with output redirection:


$ echo "firstfile" > copyme

The greater-than sign tells the shell to write echo's output to a file called copyme. This file will be created if it doesn't exist, and will be overwritten if it does exist. By typing ls -l, we can see that the copyme file is 10 bytes long, since it contains the word firstfile and the newline character:


$ ls -l copyme
-rw-r--r--    1 root     root           10 Dec 28 14:13 copyme

Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact