LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-25-2010, 06:44 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
How to edit inittab file?


Hi,
The default setting of linux is run level 5 (Red Hat 9) I want to use my system in Runlevel 1. For that purpose i 1st check the permission which were

-rw-r--r--

I want to edit the File " vim /etc/inittab " in the terminal .please let me know which line should i edit so I may use it in a single mode.

2-The second thing i want to ask that before editing any important file which are /etc like "inittab" can i 1st make it's copy and keep it in my home directoty so,in case of any mistake I can get my original file?

What u suggest me
thanks in advance.
mypass

Last edited by gardenair; 03-25-2010 at 06:49 AM.
 
Old 03-25-2010, 07:02 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by gardenair View Post
Hi,
The default setting of linux is run level 5 (Red Hat 9) I want to use my system in Runlevel 1. For that purpose i 1st check the permission which were

-rw-r--r--
What file do these permissions belong to? What is your effective user id when doing the editing?

Quote:
I want to edit the File " vim /etc/inittab " in the terminal .please let me know which line should i edit so I may use it in a single mode.
The inittab file comes well commented, that includes a note letting you know which line is responsible for setting the default runlevel. You should however read the inittab man page (just type "man inittab") before doing anything at all.

If you only need to operate in runlevel 1 once (or once in a while) there are ways to boot into that runlevel without having to edit the inittab file. For example, just pass "1" as an argument to the kernel boot line.

Quote:
2-The second thing i want to ask that before editing any important file which are /etc like "inittab" can i 1st make it's copy and keep it in my home directoty so,in case of any mistake I can get my original file?
You can copy any file to any location. But if you don't know how to copy a file, in first place, you shouldn't be messing with system files...

From command line, you can use "cp" to copy files. Use "cp -a" to preserve permissions and ownerships.

"cp" also has a man page, just like almost every regular command.
 
Old 03-25-2010, 07:49 AM   #3
sreeharsha.t
Member
 
Registered: Jan 2009
Location: Mumbai, India
Distribution: Fedora 9, 10,11, RHEL 5
Posts: 67

Rep: Reputation: 18
Smile

Hi,

Change the line :
Code:
id:5:initdefault
to
Code:
id:1:initdefault:
But, before you do consider whether you really want to do this as suggested by i92guboj.

You can take a backup of any file provided you have a read permission on it. To take the backup of the inittab file:

Code:
cp /etc/inittab /home/harsha/inittab.bk
To recover using the backup

Code:
cp /home/harsha/inittab.bk /etc/inittab
Regards,
Harsha
 
  


Reply



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
How to edit file inittab from console rarun Linux - Desktop 3 02-16-2007 06:28 PM
Inittab edit not working right jstephens84 Debian 13 07-12-2006 06:08 AM
edit inittab C_J Linux - Newbie 4 01-24-2005 11:33 AM
Recover/edit of /etc/inittab from GRUB sujith_marar Linux - General 1 09-11-2004 01:19 PM
Permision error when trying to edit 'inittab' /home/kyle Linux - Software 13 03-12-2004 05:19 PM

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

All times are GMT -5. The time now is 09:33 PM.

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