Results 1 to 8 of 8

Thread: 'vi' - 'touch' Commands Difference

  1. #1
    Expert Member
    Join Date
    May 2009
    Answers
    1,374

    'vi' - 'touch' Commands Difference

    What is the fundamental difference between the commands 'vi' and 'touch' ??


    Thanks

    Last edited by admin; 05-24-2009 at 11:15 PM.

  2. #2
    Junior Member
    Join Date
    Oct 2008
    Answers
    6

    Thumbs up Re: commands difference............

    Hi Friends,


    There is no difference between vi and touch
    vi comes from vim and its a Editor.
    touch is used for time stamping and also it is used for create empty files.
    using touch -a and touch -m you can access and modify a files.




    Regards
    Seshadri Sethi

    Last edited by sesethi; 05-22-2009 at 05:22 PM.

  3. #3
    Junior Member
    Join Date
    May 2009
    Answers
    2

    Re: commands difference............

    Hi rijus ,

    Basically 'vi' is an editor which opens a blank file which u can edit (By pressing insert button) and save it (By pressing ctrl then :wq!.And 'touch just create empty file it does not opens it for editing.


  4. #4
    Contributing Member
    Join Date
    Dec 2008
    Answers
    76

    Re: 'vi' - 'touch' Commands Difference

    @Rijus,

    Vi - a programmers text editor.
    It can be used to edit all kinds of plain text. It is especially useful for
    editing programs.
    Mainly used by Unix programmers.
    Nowadays, knowing to work in vi is an added advantage for Oracle DBA's /Developers.

    Touch- change file timestamps
    Update the access and modification times of each FILE to the current time.
    Scenario 1 :
    I u feel to create a empty file means, go for touch command.
    Scenario 2:
    You have alredy created a file with some contents,
    Then if you are thinking to change only the timestamp of that old file to current timestamp
    Then just do
    touch filename
    It will change the file timestamp to current timestamp without changing any contents in the file.

    Believing, from the above points u can figure out the complete usage of vi/touch Somehow.


  5. #5

    Re: 'vi' - 'touch' Commands Difference

    and also u can create empty files using touch command
    touch <filename>


  6. #6
    Junior Member
    Join Date
    Jun 2009
    Answers
    1

    Wink Re: 'vi' - 'touch' Commands Difference

    touch will create a file with 0size>> helpful for redirecting data or content
    where as vi is the editor which helps for the editing data of a file


  7. #7
    Junior Member
    Join Date
    May 2009
    Answers
    4

    Re: 'vi' - 'touch' Commands Difference

    Hi,
    Vi is the editor while touch is only command which can create an empty file
    Using Vi editor we can write the programmes and execute it.

    Thanks,
    Pinky


  8. #8

    Re: 'vi' - 'touch' Commands Difference

    Hello All,

    The major difference between vi and touch is that touch update your file from current date but vi used to edit the file.

    For Example:-

    # touch hi

    # vi hi

    # echo "This is testing" > hi

    # touch hi

    # ll

    You will see that your hi file is updated with the current time but content will be same.





    Post your more blog here


  9.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact