LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2010, 07:44 AM   #1
Linux.Girl
Member
 
Registered: Aug 2010
Posts: 53

Rep: Reputation: 2
how to copy a directory (local) from terminal with progress bar showing


Hello everyone,

I am new both here and in Linux. As the subject says, I would like to learn how to copy a directory (not a file) from terminal with progress bar showing. The copy is local, i.e., not to another computer.

My distro is CentOS 5.5.

I know that if I do it with nautilus I would see the progress, but I want to learn how to do it from the terminal.

I know that PV command can show a progress bar, but from what I saw, it works well for files, but not for directories (recursive). Is it possible to use PV for directories? If yes, could you please show me the syntax?

I also saw that some people mentioned that rsync can also show a progress bar, I tried to do it, but it didn't work out - perhaps I got the syntax wrong. If rsync can really be used to copy directories with progress bar, could you please show me the syntax?

Any other ideas on how to do it? I would like ideas that do not involve using any script, i.e., just something that I can do using the regular commands.

Many thanks in advance.

Linux.Girl

Last edited by Linux.Girl; 08-19-2010 at 08:10 AM.
 
Old 08-19-2010, 08:16 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
look at here

http://www.linuxquestions.org/questi...ss-bar-407381/
 
Old 08-19-2010, 08:28 AM   #3
Linux.Girl
Member
 
Registered: Aug 2010
Posts: 53

Original Poster
Rep: Reputation: 2
Thanks sem007. I saw this thread before, but it didn't help me.

As I mentioned in my question, I do not want to use a script, I want to use the regular commands available.

The thread also mentions PV and rsync, but without much detail. I am very very new and I need someone to show me the exact syntax to copy a directory (localy) using PV. I still don't understand well enough what rsync does and how does it work, hence the PV preference.

Still, thanks for trying to help.

Linux.Girl
 
Old 08-19-2010, 09:43 AM   #4
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Just as a trick, you can use scp with @localhost:
Code:
scp -r <source> user@localhost:<target>
or rsync with --progress parameter:
Code:
rsync -rvh --progress...

Last edited by quanta; 08-19-2010 at 09:48 AM.
 
1 members found this post helpful.
Old 08-19-2010, 09:47 AM   #5
Linux.Girl
Member
 
Registered: Aug 2010
Posts: 53

Original Poster
Rep: Reputation: 2
Thanks quanta - wow!

Another quick question, if you don't mind: Can you please explain to me what the "user@localhost" means in the scp example that you gave? i.e., why the syntax is

scp -r <source> user@localhost:<target>

as opposed to

scp -r <source> <target>

Sorry, I'm a newbie!

Thanks a lot!

Linux.Girl
 
Old 08-19-2010, 09:59 AM   #6
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by Linux.Girl View Post
Can you please explain to me what the "user@localhost" means in the scp example that you gave? i.e., why the syntax is

scp -r <source> user@localhost:<target>

as opposed to

scp -r <source> <target>
scp is often used to copy file to remote host. Here, you can use @localhost as a trick to copy on local. user is `whoami`
 
1 members found this post helpful.
Old 08-19-2010, 10:00 AM   #7
Linux.Girl
Member
 
Registered: Aug 2010
Posts: 53

Original Poster
Rep: Reputation: 2
ahhh, ok, no, I don't need to copy it to a remote host, just locally in my computer. So I guess rsync would be the best option (to copy directory locally with progress bar)?

Thanks agains!
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display file copy progress bar bmcneely0 Linux - General 12 02-19-2012 03:19 PM
How to Copy files from local directory to a particular directory using alias dynamics Linux - Newbie 7 09-11-2009 04:19 PM
copy at terminal with progress bar. DoME69 Programming 6 03-10-2009 01:41 PM
Showing progress bar while using SFTP paragkalra Linux - Networking 4 07-24-2008 11:49 PM
How the Progress Bar of a copy file/directory process is progressed?(any logic)? kiranprashant Programming 3 03-08-2005 06:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration