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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
11-01-2003, 07:32 PM
|
#1
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Rep:
|
whats the open command?
what is the command to open something if i know the directory of it?
|
|
|
|
11-01-2003, 07:34 PM
|
#2
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
If its in your users path, simply type the name of it.
If its not in your users path, type the whole path out to the command or cd into the directory and then type ./command-name
|
|
|
|
11-01-2003, 07:45 PM
|
#3
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
umm none of that worked
|
|
|
|
11-01-2003, 07:47 PM
|
#4
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
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
|
|
|
|
11-01-2003, 07:50 PM
|
#5
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Quote:
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.
Regards.
|
|
|
|
11-01-2003, 07:51 PM
|
#6
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
sorry and thanks
|
|
|
|
11-01-2003, 07:53 PM
|
#7
|
|
LQ Addict
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661
Rep:
|
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.
|
|
|
|
11-01-2003, 07:55 PM
|
#8
|
|
Member
Registered: Apr 2003
Location: Australia
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.
|
|
|
|
11-01-2003, 07:57 PM
|
#9
|
|
Member
Registered: Apr 2003
Location: Australia
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:
|
We all got in didn't we. Feel bombarded? Must be a good feeling then
|
|
|
|
11-01-2003, 07:58 PM
|
#10
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
when i vi to the inittab file it brings it up but i cant edit it, i can move my cursor all around in there but i cannot change anything
Last edited by zexter; 11-01-2003 at 08:01 PM.
|
|
|
|
11-01-2003, 08:01 PM
|
#11
|
|
LQ Addict
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661
Rep:
|
you have to be root for inittab and other files not in your home directory. Use
su
to become root and then open it.
|
|
|
|
11-01-2003, 08:02 PM
|
#12
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
im already root.... i logged in as root
|
|
|
|
11-01-2003, 08:11 PM
|
#13
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Quote:
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.
|
|
|
|
11-01-2003, 08:18 PM
|
#14
|
|
Member
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210
Original Poster
Rep:
|
thank you and sorry, and ya i did search.... but the I thing works i changed the id from 5 to 3, but when i hit the ESC buttton, it doesnt do anything
|
|
|
|
11-01-2003, 08:25 PM
|
#15
|
|
LQ Addict
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661
Rep:
|
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:54 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|