LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-15-2004, 11:47 AM   #1
mattsmith999
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
Editing Files Via Shell


Hi

I want to be able to fully manage my linux server via SSH. I have Mandrake 9.2 installed with samba server. I will want to add samba shares via SSH, the only way I know of doing this is to edit the samba.conf file and restart the service, so I need to be able to edit it via the shell. I login as my user and use the command su to get root privs. Where do I go from here?

Thanks in advance!

Matt
 
Old 02-15-2004, 12:09 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
well it depends what editor you want to use ... i will use "vim" in my example ..
so your now at a root prompt you can type :
vim /etc/samba/smb.conf
(thats the location on my box)
and basically just use your arrow keys when you get inside the file to move around or press :
Code:
/
and type a "keyword" to let vim find an occurance of it in real time, to get to a location quicker ..
then when you get to the part you want to edit you type :
Code:
i
to go into "insert mode" for that you can edit the contents ... and when your done editing you hit :
Code:
ESC
which gets you outta insert mode, and then you will save and quit the file by either of the following :
Code:
SHIFT ZZ
or :
Code:
:wq
these are just a couple of the basics to edit a file using vim, and there are many many more options .... you can sort through a search engine to find some docs that you like or for now you can look at :
vim simple commands
a vim tutorial
list of tutorials within the acutal HOWTO

Last edited by DrOzz; 02-15-2004 at 06:49 PM.
 
Old 02-15-2004, 12:16 PM   #3
mattsmith999
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0
DrOzz

Thank you for your very detailed reply! Will give it a go and let you know how I get on.

Matt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing text file in Shell - Konsole (SuSE 9.1) Ree Linux - Newbie 5 10-03-2004 11:48 AM
Editing properties of your terminal/shell ? fredgt Linux - Software 3 10-03-2004 10:30 AM
Editing files from shell scripts? SirRobbin Linux - Newbie 6 03-23-2004 10:27 AM
Editing a text file in shell Lotmr Linux - Software 5 06-24-2003 12:12 PM
ID3 Tag Editing with a Shell Script chrisk5527 Linux - General 5 03-20-2003 10:38 PM


All times are GMT -5. The time now is 08:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration