Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
im in the /etc directory and when i type in ./inittab it tells me permission denie.... but im in root... i have to know how to do this thru command line not thru the file browser...
Originally posted by zexter im in the /etc directory and when i type in ./inittab it tells me permission denie.... but im in root... i have to know how to do this thru command line not thru the file browser...
anyone who can help please do
thanks
That's because that is a text file and not a program. If you had provided more details, maybe I could have explained myself better.
If you want to edit text files, you need to use vi or pico or any other editor of your choice to edit them.
Simply after cd'ing into the /etc directory:
vi inittab
or
pico inittab
Will open the text file to edit and save. And before you ask how to use these console text editors, please use the search button on this site, these are very basic questions which have been asked many many times.
what do you mean by 'open'? Do you mean open it in an editor? If so,
vi {filename}
will open it in vi. {filename} can be the full path or just the name if you are in the directory where it is; e.g. vi /etc/inittab or just vi inittab if you are in /etc. You can use
emacs {filename}
to open it using emacs or
kedit {filename}
to open it in kedit or
konqueror {filename}
to open it using konqueror, etc.
edit oops, must've been typing when trickykid posted.
Distribution: Debian 3, 31r0, 4, slackware, DSL, RH8.0/7, MDK9/10, et al. Vista is cute but not Linux - I tried
Posts: 70
Rep:
You need to be more specific when you say you want to 'open' something, first off, to simply view a text file use the 'cat', 'more' or 'less' command. If you want to edit the text file use vi or whatever editor you prefer. To run a script or executable file that's not in your path you would use ./executable_name.
The inittab file in your example is a straight text file, unless you've done something funny to it and made it executable.
To be more specific:
if you just want to view the file.
cat /etc/inittab
or
less /etc/inittab
or
more /etc/inittab
if you just want to edit the file:
vi /etc/inittab
make sure you have some understanding of exiting vi before dong this or you'll become quickly frustrated and press the reset button.
Originally posted by zexter im already root.... i logged in as root
You can't use your mouse to edit. You actually have to type in commands to start editing, etc.
man vi for more details.
Some quick hints about vi since you seem to not search the site like I asked nicely:
ESC = Takes you back to command mode.
I = Puts you in Interactive mode so you can type, edit, delete contents of the file.
After you go into Interactive mode to edit by pressing I, you will then edit by moving your arrow keys over what you want to edit in the file, etc.
Then you type ESC to go back to command mode and from there you can simply type:
qw!
That will quit and write to the file the changes made.
It might not look like anything happens when you hit ESC but you should be back to command mode. Press the sequence
:w
and see if it saves the changes and then
:q
to quit the program.
BTW, are you sure you want to change the default runlevel to 3? If you do, you'll have to deal with the command line and use startx to start gui. If all you want to do is terminate X temporarily to install something, you
init 3
or
telinit 3
as root to get out of X. You can restart X with
init 5
or
telinit 5
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.