DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 23rd May 2008
delboy's Avatar
delboy delboy is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 63
Thanked 0 Times in 0 Posts
Default Permission denied

Getting "permission denied" when I try as root to access /usr/ports.
During installation I said yes to installing The Ports Collection,and I want to see if the files are there.I think I am using the wrong code,could anyone tell me the right way.
Further reading of the BSD handbook says it is better to install the Ports Collection from the internet rather than the cd,which I did,any thoughts on that.
Reply With Quote
  #2   (View Single Post)  
Old 23rd May 2008
PatrickBaer PatrickBaer is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 81
Thanked 1 Time in 1 Post
Default

cd /usr
ls -la

What does it tell you?
Reply With Quote
  #3   (View Single Post)  
Old 24th May 2008
delboy's Avatar
delboy delboy is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 63
Thanked 0 Times in 0 Posts
Default

PatrickBaer.

output from ls -la
$ cd /usr
$ ls -la
total 58
drwxr-xr-x 17 root wheel 512 May 22 11:12 .
drwxr-xr-x 20 root wheel 512 May 23 20:12 ..
drwxrwxr-x 2 root operator 512 May 22 15:36 .snap
lrwxr-xr-x 1 root wheel 10 May 22 10:35 X11R6 -> /usr/local
drwxr-xr-x 2 root wheel 7168 May 22 10:36 bin
drwxr-xr-x 3 root wheel 512 May 22 10:48 compat
drwxr-xr-x 2 root wheel 512 May 22 10:31 games
drwxr-xr-x 3 root wheel 512 May 22 11:12 home
drwxr-xr-x 47 root wheel 4608 Feb 24 21:18 include
drwxr-xr-x 6 root wheel 10752 Feb 24 21:18 lib
drwxr-xr-x 5 root wheel 512 Feb 24 21:18 libdata
drwxr-xr-x 5 root wheel 1536 Feb 24 21:18 libexec
drwxr-xr-x 13 root wheel 512 May 22 10:34 local
drwxr-xr-x 2 root wheel 512 May 22 10:41 obj
drwxr-xr-x 69 root wheel 1536 May 22 10:32 ports
drwxr-xr-x 2 root wheel 5120 May 22 10:29 sbin
drwxr-xr-x 26 root wheel 512 May 22 10:31 share
drwxr-xr-x 23 root wheel 512 May 22 10:32 src
Reply With Quote
  #4   (View Single Post)  
Old 24th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

What command did you use?
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 24th May 2008
delboy's Avatar
delboy delboy is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 63
Thanked 0 Times in 0 Posts
Default

Carpetsmoker

# cd /usr
# /usr/ports
Reply With Quote
  #6   (View Single Post)  
Old 24th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

You need to type "cd", now you're trying to execute a directory ... Which doesn't work, this should work: % cd /usr/ports

If you are using tcsh you can use implicitcd option ("set implicitcd" in ~/.tcshrc) so you don't have to type "cd", from tcsh(1)
Code:
      implicitcd (+)
               If set, the shell treats a directory name typed as a command as
               though  it  were a request to change to that directory.  If set
               to verbose, the change of directory is echoed to  the  standard
               output.   This  behavior  is inhibited in non-interactive shell
               scripts, or for  command  strings  with  more  than  one  word.
               Changing directory takes precedence over executing a like-named
               command, but it is done after alias substitutions.   Tilde  and
               variable expansions work as expected.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #7   (View Single Post)  
Old 24th May 2008
delboy's Avatar
delboy delboy is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 63
Thanked 0 Times in 0 Posts
Default

Carpetsmoker.

Using % cd /usr/ports just presents me with another command prompt.
Reply With Quote
  #8   (View Single Post)  
Old 24th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

Yes, you can use % pwd to check which directory you're in:
Code:
% cd /usr/ports/
% pwd
/usr/ports
You can add this to your ~/.tcshrc to show the current directory in the prompt:
Code:
set prompt = "[%~]%% "  # Show current dir.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #9   (View Single Post)  
Old 24th May 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Thanked 20 Times in 18 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
If you are using tcsh you can use implicitcd option ("set implicitcd" in ~/.tcshrc) so you don't have to type "cd", from tcsh(1)
Im pretty sure all popular shells can be configured to let user navigate dir without `cd`, but personally I dont think its a good practice
__________________
The power of plain text? It can control an entire OS
Reply With Quote
Old 24th May 2008
delboy's Avatar
delboy delboy is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 63
Thanked 0 Times in 0 Posts
Default

Carpetsmoker.

Finally got it,thanks for all your help.
Reply With Quote
Old 24th May 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

zsh can and afaik does by default, never knew tcsh had an implicitcd option but i never bothered to customize it that much (tcsh/zsh == my most used shells).

it's bad practice imho to rely on it but it is a nice feature if you forget to type the command -- assuming you meant to change directories in the first place.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 24th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

Quote:
Originally Posted by 18Googol2 View Post
Im pretty sure all popular shells can be configured to let user navigate dir without `cd`, but personally I dont think its a good practice
Well, tcsh is the only shell I'm familiar with, and since it's the FreeBSD default I think it's safe to assume that delboy's using tcsh...

In any case, I don't see why it's bad practice ...
One disadvantage would be:
Code:
% mkdir vi
% vi
% pwd
/home/carpetsmoker/vi
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
/tmp on ram write denied gosha OpenBSD General 8 29th March 2009 04:46 PM
FFS permission issue marc OpenBSD General 2 2nd February 2009 07:31 PM
Permission denied (publickey). Help pls rex FreeBSD General 13 14th October 2008 08:54 PM
Tightvnc startup script not loading fonts - permission denied master-richie FreeBSD Ports and Packages 2 3rd August 2008 09:29 PM
FTPD User Access Denied wastedbreath FreeBSD General 7 21st May 2008 03:44 AM


All times are GMT. The time now is 04:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick