Tuesday, July 10, 2012

creating and appending files in ubuntu


How to create files in ubuntu, and view the content of files using editors

there are different types of editors in ubuntu, you can use nano, vi, vim these editors to view the content of the file
to install vim do like this
#apt-get install vim
then this will be installed


  1. to create an empty file
    #touch sunny
    here an empty file will be created with 0 bytes
  2. to create a file with some matter in it
    #cat > mom
    hi mom how are you
    then ctrl+d to save
  3. to view the connect of the file
    # cat mom
    hi mom how are you
  4. to append the matter in already present file
    # cat >> mom
    hi mom how are you
    hi mom this is your son
    ctrl+d to save
  5. to view the content you can use these
    #vim mom
    after this to save w!
    To save and quit wq
    To save and quit forcefully wq!
    To quit forcefully q!
    and other like this
    #vi mom
    and also can use
    #nano mom
    here click x to save
    and Y for yes

No comments:

Post a Comment