Unix/Linux 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 06-27-2013
vidyadhar85's Unix or Linux Image
vidyadhar85 vidyadhar85 is offline Forum Advisor  
The Tutor
 
Join Date: Jun 2008
Last Activity: 17 April 2015, 12:45 AM EDT
Location: INDIA, Bangalore
Posts: 2,049
Thanks: 16
Thanked 106 Times in 102 Posts
you can use vi editor to edit the files.
Sponsored Links
    #3  
Old Unix and Linux 06-27-2013
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 21 March 2015, 4:46 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 4,485
Thanks: 50
Thanked 919 Times in 721 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 Unix and Linux 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.Unix or Linux Image


Unix or Linux Image
Sponsored Links
    #5  
Old Unix and Linux 06-27-2013
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 24 April 2015, 10:47 AM EDT
Location: Switzerland - GE
Posts: 6,026
Thanks: 182
Thanked 452 Times in 423 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 Unix and Linux 06-30-2013
vinil vinil is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 16 March 2015, 5:50 AM EDT
Posts: 46
Thanks: 1
Thanked 2 Times in 2 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 Unix and Linux 06-30-2013
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 24 April 2015, 9:11 PM EDT
Location: San Jose, CA, USA
Posts: 6,131
Thanks: 249
Thanked 2,031 Times in 1,735 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 09:53 PM.