1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Shell Help: Move file contents into another file

Discussion in 'Shell Script' started by niconico96, Aug 28, 2010.

  1. niconico96

    niconico96 New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello.
    I have a file, with some HTML in it.
    I would like to make a shell/bash script that moves ALL of the content of that file into ANOTHER HTML file at a CERTAIN line number...
    Does anyone have any suggestions?

    If not possible at a certain line, then at the END of the file.

    Thanks a lot in advance
    ~ Nikhil
     
  2. Prakhar14

    Prakhar14 New Member

    Joined:
    Apr 27, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    For at the end of line, you can use tail command like this;
    tail -n > file

    where n is the line from the last as tail -10 means last 10 lines and the above command will save the output at file.
     

Share This Page