?
Solved

Why does this command not work?

Posted on 2014-07-19
6
Medium Priority
?
392 Views
Last Modified: 2014-07-21
When I run this command:

$ chmod 777 cache/ log/

I get this:

-bash: $: command not found

This is killing me. I'm trying to make my way through, what should be, a very basic and intuitive Symfony tutorial, and it's like pulling teeth. What am I doing wrong with the above shell command?

Thanks.
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 84

Assisted Solution

by:ozo
ozo earned 500 total points
ID: 40206878
Try it without the $
chmod 777 cache/ log/
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 500 total points
ID: 40206922
It could be that your env variable PATH is not set correctly.

run below command and see:

echo $PATH

or

run this command

which chmod
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 40206942
You may not have permissions.  If it's Ubuntu, you will need to use 'sudo' first and give your password.  But that only works if you are included in the 'sudo' users group.
sudo chmod 777 cache/ log/

Open in new window

0
Limited time offer using promo code EXPERTS30

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through September 15, 2017, Experts Exchange members get 30% off the US7220 on the ATEN USA eShop using promo code EXPERTS30.

 
LVL 21

Accepted Solution

by:
tfewster earned 500 total points
ID: 40206960
I think ozo is right - the "$" indicates the command prompt that you type the chmod command at simlar to C:\> , not something you need to type yourself. The equivalent prompt for the root user would be "#", but typing the "#" at the front of a command would act to comment the command out.

* The prompt can be changed by modifying the PS1 environment variable
0
 

Author Comment

by:brucegust
ID: 40209123
Hey, folks!

Thanks so much for your time!

Here's what I tried:

Last login: Mon Jul 21 06:57:02 on console
Bruce-Gusts-iMac:~ bruce$ chmod 777 cache/log/
chmod: cache/log/: No such file or directory
Bruce-Gusts-iMac:~ bruce$ which chmod
/bin/chmod
Bruce-Gusts-iMac:~ bruce$


You'll see the first command was a deployment of the first suggestion, which was to eliminate the "$" symbol prior to the command. After that, I ran the "which chmod" and got what you see above.

What do you think?
0
 

Author Comment

by:brucegust
ID: 40209175
I figured it out!

The instructions that I was following necessitate being at a specific directory and I wasn't there when I attempt the chmod command. Once I positioned myself in the appropriate folder where the cache and log folders existed, I could run the command without a problem.

BTW: I'm desperately making my way through a Symfony tutorial and I'm confident I will have a bunch of questions. For those of you who are looking for some easy money / points, keep the Bruce-ster in your sights and there will be plenty of opportunities.

Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Apple's Mac OS X has become an official member of the malware club. The Flashback Trojan has affected over half million Macs, worldwide. It is behavior that ultimately gets malware onto a person’s computer. Obsolete or out-of-date software helps…
Create a default user profile for Mac OS X 10.7/10.8 Create a user account on OS X that will be a template for every other user of that computer. I usually call it “profile” and make it an administrator account for the time being. 1. Install a…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question