How to edit a file on a UNIX Server | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

How to edit a file on a UNIX Server

UNIX for Dummies Questions & Answers


Tags
ajaxplorer, edit, file, terminal command, unix

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-27-2013
Blub Blub is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 27 June 2013, 8:09 AM EDT
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
How to edit a file on a UNIX Server

Hi i have to edit a file on our UNIX Server, but i have no idea how to do that. The only thing that i managed till now is to get acces to it via ssh. I get into it via Terminal because i use Osx. I have the advice to edit this file:

1 - You must edit this file:
[Ajaxplorer path] / Conf / bootstrap_repositories.php


but how can I edit it via terminal, which commands i have to write to see it and make it editable ?

I know that are really more than basical dummie questions, but I have to ask them.

Thanks a lot,

s
Sponsored Links
    #2  
Old 06-27-2013
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Advisor  
The Tutor
 
Join Date: Jun 2008
Last Activity: 9 April 2014, 1:31 AM EDT
Location: INDIA, Bangalore
Posts: 2,049
Thanks: 16
Thanked 107 Times in 103 Posts
you can use vi editor to edit the files.
Sponsored Links
    #3  
Old 06-27-2013
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 20 April 2014, 3:47 PM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 3,919
Thanks: 39
Thanked 671 Times in 533 Posts
Use "ls" to list file. Use "vi" to edit it. Attention: "vi" is quite dissimilar to any other editor, so you probably want to read a bit about how it works before you start editing your file.

If you need help for any command issue "man <cmd>" to get help. In most cases there are examples aobut the usage too. Press "CTRL-C" to end the display of the man pages.

One last thing: paths are written without spaces and are case-sensitive, so "Conf" might be "conf", but these two would be not the same:


Code:
[Ajaxplorer path]/Conf/bootstrap_repositories.php
[Ajaxplorer path]/conf/bootstrap_repositories.php

I hope this helps.

bakunin
The Following User Says Thank You to bakunin For This Useful Post:
Blub (06-27-2013)
    #4  
Old 06-27-2013
Blub Blub is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 27 June 2013, 8:09 AM EDT
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
if i type it on my home directory all files show up.. if i connect to the server and type ls or
ls -- nothing happen.


Sponsored Links
    #5  
Old 06-27-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 17 April 2014, 3:54 AM EDT
Location: Switzerland - GE
Posts: 5,490
Thanks: 148
Thanked 362 Times in 339 Posts
Certainly because you are in your home directory and so far you have no files except perhaps the hidden files...
The Following User Says Thank You to vbe For This Useful Post:
Blub (06-27-2013)
Sponsored Links
    #6  
Old 06-30-2013
vinil vinil is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 20 April 2014, 7:01 AM EDT
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Hi
View/Edit a file in unix is quite easy indeed.You may like the following to use
1 cat <file_name>
2 cat><filename>
3 vi <filename>

Note that 1st option is to VIEW file only.You will not be able to write in this mode.
2nd and 3rd options make you enable to edit a file.
Be cautious when you edit a file using 3rd option as it may need a bit more knowledge about VI editor prior to use.
But there is no harm in using the 2nd option mentioned above
thanks .
Sponsored Links
    #7  
Old 06-30-2013
Don Cragun's Avatar
Don Cragun Don Cragun is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 20 April 2014, 2:06 PM EDT
Location: San Jose, CA, USA
Posts: 3,471
Thanks: 141
Thanked 1,202 Times in 1,018 Posts
Quote:
Originally Posted by vinil View Post
Hi
View/Edit a file in unix is quite easy indeed.You may like the following to use
1 cat <file_name>
2 cat><filename>
3 vi <filename>

Note that 1st option is to VIEW file only.You will not be able to write in this mode.
2nd and 3rd options make you enable to edit a file.
Be cautious when you edit a file using 3rd option as it may need a bit more knowledge about VI editor prior to use.
But there is no harm in using the 2nd option mentioned above
thanks .
Suggesting redirecting output from the cat utility to edit a file is an EXTREMELY dangerous suggestion for a new user. The first thing that the command:

Code:
cat > filename

does is delete everything in the file named filename. The user then has to retype the exact original contents of every line in the original file except for the changes to be made to the single line that you want to change.
The Following User Says Thank You to Don Cragun For This Useful Post:
RavinderSingh13 (07-12-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell: uploading file from UNIX server to sharepoint server scriptscript Shell Programming and Scripting 0 01-24-2013 04:29 AM
Perl: Sending file from UNIX server to Windows server kooshi Shell Programming and Scripting 2 11-12-2010 09:47 PM
To copy a file from one unix server to another unix server through scripts manit UNIX for Dummies Questions & Answers 1 09-02-2009 11:49 AM
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 06:35 AM
how to edit large file in unix balireddy_77 Shell Programming and Scripting 3 12-14-2006 06:40 AM



All times are GMT -4. The time now is 05:31 PM.