Solved

Why does this command not work?

Posted on 2014-07-19
6
375 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 83

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
Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

867 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

15 Experts available now in Live!

Get 1:1 Help Now