LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permission Denied (https://www.linuxquestions.org/questions/linux-newbie-8/permission-denied-263326/)

harlspy 12-06-2004 03:10 PM

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?

mjrich 12-06-2004 03:28 PM

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

aaa 12-06-2004 03:28 PM

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".

csfalcon 12-06-2004 04:50 PM

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 :rolleyes:

hey aaa, you sure crazy about wiki! check my website out and see if it is your cup of tea.

harlspy 12-06-2004 07:21 PM

Thank You
 
Big Thanks for all your info. It was driving me crazy. I really like Linux but guess theres alot to learn.

J.W. 12-06-2004 07:38 PM

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.

cs-cam 12-07-2004 12:41 AM

If you're in KDE then kwrite /etc/hosts :) Nice GUI and everything ;)

mjrich 12-07-2004 02:34 PM

...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 !).

ralvez 12-07-2004 02:52 PM

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


All times are GMT -5. The time now is 02:19 PM.