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-06-2004, 03:10 PM   #1
harlspy
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
Permission Denied


Hello,
I am trying to learn how to use Linux. I installed Mandrake 10 and I am using the KDE enviroment. When I try to do anything in the shell I get a Permission Denied error. For example if I switch to root using su and then type in /etc/hosts it comes up with Permission Denied. I'm totally stumped on how to get past this. Any suggestions would be great?
 
Old 12-06-2004, 03:28 PM   #2
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Just typing /etc/hosts won't get you very far What do you want to do ? To edit, type: vim /etc/hosts (or emacs /etc/hosts, if you're that way inclined... To read, type: less /etc/hosts, and so on.

Cheers,

mj
 
Old 12-06-2004, 03:28 PM   #3
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
You get permission denied when you try to run a file that's not executable. Typing "/bin/ls" should work, whereas the text file /etc/hosts will not. To view it, you use a text editor. For example, "vi /etc/hosts".
 
Old 12-06-2004, 04:50 PM   #4
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
If you start editing with vi, to quit type
Code:
:q!
I still remember the first time I entered vi, I didn't know how to get out

hey aaa, you sure crazy about wiki! check my website out and see if it is your cup of tea.
 
Old 12-06-2004, 07:21 PM   #5
harlspy
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thank You

Big Thanks for all your info. It was driving me crazy. I really like Linux but guess theres alot to learn.
 
Old 12-06-2004, 07:38 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
As a side comment, one of the easiest text editors to use is pico because it always displays the key combinations for common actions at the bottom of the screen. vi and vim are both powerful, but at least to me they aren't as easy to use as pico. Just my 2 cents -- J.W.
 
Old 12-07-2004, 12:41 AM   #7
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
If you're in KDE then kwrite /etc/hosts Nice GUI and everything
 
Old 12-07-2004, 02:34 PM   #8
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
...and use :wq if you actually want to save your changes within Vim, if this is what you end up using (:q! will leave you back where you started !).
 
Old 12-07-2004, 02:52 PM   #9
ralvez
Member
 
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298

Rep: Reputation: 30
Keep in mind also that if you just want to see the contents of a file (assuming it is a text file) you can use "cat" like this: cat /etc/fstab or cat /etc/hosts.

Hope this helps
 
  


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
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
Permission Denied jamesvenning1 Linux - Newbie 4 06-05-2005 11:32 AM
Permission denied jagman026 Fedora 3 01-01-2005 03:45 PM
Permission Denied ptreves Linux - Newbie 7 12-16-2004 02:14 PM
Permission denied? jbhoo Linux From Scratch 1 04-27-2002 09:12 PM

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

All times are GMT -5. The time now is 04:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration