Solved

Why does this command not work?

Posted on 2014-07-19
6
371 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
6 Comments
 
LVL 84

Assisted Solution

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

Assisted Solution

by:omarfarid
omarfarid earned 125 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 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 20

Accepted Solution

by:
tfewster earned 125 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now