Results 1 to 9 of 9
Hi all,
Since its my first time the using command line in Putty I am having some difficulties. Maybe someone could help me out or point me in the right ...
- 07-31-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 5
How to use mv command in Putty
Hi all,
Since its my first time the using command line in Putty I am having some difficulties. Maybe someone could help me out or point me in the right direction.
Right know I made a file name gorilla.tar.gz in public_html/monkeys/
But i wanna put it in public_html/zoo/ and than extract it there.
when I do mv gorilla.tar.gz public_htm/zoo/
i get an error message.
So in a nutshell. On the same server i wanna move a file from one directory (monkeys) to another (zoo)
Oh I also used PWD to see where i am, but i haven't no clue what parts to use in the MV command.
Hope to hear from some guru's
- 07-31-2010 #2
That's mv <present location> <new location>
Do you have write permission in the new location?
What is the exact error message?
I'm assuming you are working at a command shell,
through telnet or ssh. Ftp commands are different.
- 07-31-2010 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 5
Wow thx for your lightning speed reponse.
I am pretty sure i have writing permission in the new folder. But the problem I am facing is that I dont know what path to include. If I type "pwd" I get a wickedly long path /www/d/a/v/my-domain.com/public_html
I must say i just started today with this commandline stuf, but I'ts hard to find the the proper examples. Is there maybe some guide with working examples instead of the riddled stuff i get when typing "man"
I also tried this guide which i am not allowed to link to?: Oh Learning Journal - Backup / Move a Website I that explain how to make a tarbal, which works in a way but i always get the error:
(tar: getgrgid(80) failed: Permission denied)
Anyways i used this line which i found somewhere:
cp -av * ../newdir : Copies all files and directories recurrsively in the current directory INTO newdir
so I type in when I am standing in the target directory (monkeys):
cp -av * /public_html/zoo
resulting in this error: usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... target_directory
This is really mind goggling for me
- 07-31-2010 #4Just Joined!
- Join Date
- Jul 2010
- Posts
- 5
Well it seems i found a workaround, but please inform me if this was the right way.
The goal was to copy all files and folders from one directory(gorilla) into another (zoo). This is what i did and it seems it worked:
Logged in to PuTTy and than went to public_html by using: cd public_html
I than typed the following:
cp -rp ~/public_html/gorilla/* ~/public_html/zoo/
This seemed to have worked, i added the ~ myself because I had difficulties knowing the stuff to put in infront and without out it i kept getting errors like:
no such file or directory.
Would love to hear from you guys since this forum is named after me
- 07-31-2010 #5
The ~ symbol is shorthand for the user's home directory,
so if it worked, yes that's good. It's easier than typing that
long path.
- 07-31-2010 #6Just Joined!
- Join Date
- Jul 2010
- Posts
- 5
Thanks alot m8 for spending time on my post. Maybe it even helps someone else, would be nice

Btw i saw alot of examples on the internet with indeed /home/... in it, but when in did pwd, i didn't see a home folder. Maybe thats because I am on a shared host (but that's just a wild uneducated guess). Atleast i now know how to deal with it. Thanks for confirming this,
Bye!
- 08-01-2010 #7
You could also have done
mv ~/public_html/gorilla/* ~/public_html/zoo/If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 08-01-2010 #8
Also helpful rather than writing out long directory names is to utilize tab completion. Incredibly useful feature of BASH and other shells.
- 08-01-2010 #9Just Joined!
- Join Date
- Jul 2010
- Posts
- 5
Oh nice, Thx guys really appreciate it. Soon ill be a command line guru


Reply With Quote