Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cleo

macrumors 65816
Original poster
Jan 21, 2002
1,186
0
Tampa Bay Area, FL, USA
Ok, I've got about 75 files on a server that I need to chmod, all cgi's. The easiest way to do this, I assumed, would be with a wildcard. But.

When I type ls *.cgi all 75+ files are returned. When I type chmod 755 *.cgi I get ac "no such file or directory" error.

What gives?
 

d_p

macrumors newbie
Jan 6, 2004
8
0
DC
Try this: /bin/chmod 755 ./*.cgi
Also, make sure you are the owner of the files or root.
 

abhishekit

macrumors 65816
Nov 6, 2003
1,297
0
akron , ohio
Are they all in a single folder ? if yes, you can goto that folder and write

chmod -R 755 *

it would change the permissions for all files.
 

tomf87

macrumors 65816
Sep 10, 2003
1,052
0
Sounds to me like your chmod program is gone or corrupt or has bad permissions.

Do a 'which chmod' then a 'ls -l <output of earlier which command>:

Code:
mac:~ username$ which chmod
/bin/chmod
mac:~ username$ ls -l /bin/chmod
-r-xr-xr-x  1 root  wheel  14436 30 Aug 21:35 /bin/chmod
mac:~ username$

Does yours look similar to mine? My output is from 10.3.5.
 

Westside guy

macrumors 603
Oct 15, 2003
6,341
4,159
The soggy side of the Pacific NW
The files in question are on a server, not on your local machine? What OS is on the server? You can find the OS on most *nix-ish machines by typing "uname -a" from the command prompt.

The "which" command mentioned above is a good bet to resolve this.

I am wondering if the server in question is running your session in a "chroot jail". Often-times you'll have a very limited set of commands available to you in that situation.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,644
4,041
New Zealand
I ran into a similar problem just yesterday when I typed 'mv somefilename.conf *.bak' and ended up with a file named *.bak, which of course isn't what I expected! So it looks like some commands support wildcards, but others don't.

BTW, what's the difference between 'which' and 'whereis'?
 

Westside guy

macrumors 603
Oct 15, 2003
6,341
4,159
The soggy side of the Pacific NW
Nermal said:
I ran into a similar problem just yesterday when I typed 'mv somefilename.conf *.bak' and ended up with a file named *.bak, which of course isn't what I expected! So it looks like some commands support wildcards, but others don't.

BTW, what's the difference between 'which' and 'whereis'?

Wildcards generally need to be part of the "target" file/directory rather than the "result" (bad terminology, I know).

"which" basically tells you "if I type command 'xxxx', what binary will be run (if any)?" "whereis", on the other hand, will show you all the versions of command 'xxxx' that exist in your path. So if you have three versions of the command 'ssh', which will return one entry, while whereis will return three entries.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.