LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2004, 09:05 AM   #1
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Rep: Reputation: 30
Editing text Files


Hiya
how do i edit text files or files wihich can be editited only by root member ? i
 
Old 12-24-2004, 09:07 AM   #2
dizzutch
Member
 
Registered: Sep 2004
Location: Worcester, MA USA
Distribution: Debian, Gentoo, Fedora FC2
Posts: 66

Rep: Reputation: 15
if you have access to the root password

$su -
$vi /dir/to/file

if you have sudo access
$sudo vi /dir/to/file

otherwise, you can't then there is a reason they're root access only.

-JSS
 
Old 12-24-2004, 02:02 PM   #3
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
For simple text editing I like nano nano -w <path to filename>
http://www.gentoo.org/doc/en/nano-basics-guide.xml
 
Old 12-24-2004, 03:34 PM   #4
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
Cant we l;og in like how we log in with user id n p/w cant we do same with root id n p/w??
 
Old 12-24-2004, 03:42 PM   #5
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by dizzutch
if you have access to the root password

$su -
$vi /dir/to/file

if you have sudo access
$sudo vi /dir/to/file

otherwise, you can't then there is a reason they're root access only.

-JSS
i cant understand with those /dir/to/file i want to edit a file what shd i do can ya plz help me explaining that lines
and also i cant use NANO when i type this comand in tereminal its saying bad command plz help me
 
Old 12-24-2004, 04:07 PM   #6
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
Quote:
Originally posted by coolguy4girlz
Cant we l;og in like how we log in with user id n p/w cant we do same with root id n p/w??
I think you said can I log in as root and then edit the file=yes
Say What distro and what file do you want to edit?

Last edited by comprookie2000; 12-24-2004 at 04:10 PM.
 
Old 12-25-2004, 01:56 AM   #7
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
COMPO Yes ur right ............im using mandrake 10 i want to edit modprobe.conf file
 
Old 12-25-2004, 06:34 AM   #8
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
See if you have in the menu a filemanager super user mode,you using kde?
 
Old 12-25-2004, 02:40 PM   #9
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
yes im using KDE but cant find "super user mode"
 
Old 12-25-2004, 06:14 PM   #10
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
O.K. log out and log in as root,browse to the file in Konqueror,open it with kwrite and edit it.
 
Old 12-26-2004, 05:00 AM   #11
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
i m automatically getting logged in as "my username" when i logged out what should i do now i cant even edit the inittab file so that i can start with super user mode plz help
 
Old 12-26-2004, 07:49 AM   #12
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
You should go to the command line terminal - in Mandrake, that's probably the programs Konsole or xterm.
Here, you can change to the super user - also known as root - by typing
Code:
su
You will be asked for the administrator password. Enter it, and you are root. You can then start the editor from the command line. That is probably gedit or KWrite. Once you have started the editor, you can open the file from the editor. Then the file will be edited with root rights, and you can save the changes.
You should use the su command to have administrator rights for short, specific tasks. You should not log in from the beginning as the super user/root/administrator.

Last edited by mjjzf; 12-26-2004 at 07:59 AM.
 
Old 12-26-2004, 11:21 PM   #13
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
That worked DIPLOMAT thanks for ya help nad thanks all those who tried to help me
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DOS text files to UNIX text files ta0kira Linux - Software 7 03-15-2011 11:42 AM
Editing/manipulating text files winchester169 Linux - Software 3 08-18-2005 06:01 PM
editing text files killertofu Linux - Newbie 2 10-15-2004 05:55 PM
text editing machinemen Linux - Newbie 2 06-18-2004 04:38 AM
Text editing PhuckFonix Linux - Newbie 5 05-22-2004 09:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration