i need to access the /ec/hosts file
I am in the terminal and trying to access the /etc/hosts but i get the message "Permission denied so I run the command 'su' it asks for my password I type in the password and then do the command to go to /etc/hosts and it tells me permission denied.... what is it i'm doing wrong ??
nate@Nate3 ~ $ /etc/hosts bash: /etc/hosts: Permission denied nate@Nate3 ~ $ su Password: Nate3 nate # /etc/hosts bash: /etc/hosts: Permission denied Nate3 nate # thanks, Nate |
/etc/hosts isn't a script or anything, it's basically just a configuration file. So, trying to run it on the command line as you are makes no sense. FWIW, you get the permission denied message because the file doesn't have execute permissions (again, because that makes no sense for the type of file it is). You need to edit it with whichever editor you use.
|
Quote:
Code:
#vim /etc/hosts <--- edit |
You can also use pagers (e.g. less, more, most) to view the file.
|
Thanks , I got it
Nate |
Thanks , I got it
Nate |
In addition, nano is an easier editor to use if you can't (be bothered to) memorise the incredible amount of short cuts/key strokes you'd need for vim or emacs :)
|
All times are GMT -5. The time now is 11:55 AM. |