Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-06-2004, 04:10 PM   #1
LQ Newbie
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
Permission Denied

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, 04:28 PM   #2
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.


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

Rep: Reputation: 47
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, 05:50 PM   #4
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
If you start editing with vi, to quit type
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, 08:21 PM   #5
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, 08:38 PM   #6
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, 01:41 AM   #7
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, 03:34 PM   #8
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, 03:52 PM   #9
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


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 05:50 AM
Permission Denied jamesvenning1 Linux - Newbie 4 06-05-2005 12:32 PM
Permission denied jagman026 Fedora 3 01-01-2005 04:45 PM
Permission Denied ptreves Linux - Newbie 7 12-16-2004 03:14 PM
Permission denied? jbhoo Linux From Scratch 1 04-27-2002 10:12 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration