LinuxQuestions.org
Visit Jeremy's Blog.
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-03-2013, 04:39 PM   #1
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Rep: Reputation: Disabled
Copy command to show progress bar or status


Dear members,

1: I want to see the progress of the copying process, how much done how much left and even if the system is hanged and i am waiting like a stupid :S

2: How can I see the size of a directory with ls command. I use
Code:
ls -lh
but it only shows the size of file not directories.

Please assist.
 
Old 08-03-2013, 04:44 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
man du to see the size of dirs.

i think you can program something with dialog/zenity to count the progress of file transfers.
 
1 members found this post helpful.
Old 08-03-2013, 04:49 PM   #3
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Original Poster
Rep: Reputation: Disabled
thanks Schneidz.

got that du.

for the second part, isn't it something built-in like we use with rpms say
Quote:
rpm -ivh
and that shows the process bar.
 
Old 08-03-2013, 04:51 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
not that i know of. i know that scp shows a progress bar but only during network transfers.
 
Old 08-03-2013, 05:14 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
What about rsync?
http://www.cyberciti.biz/faq/show-pr...file-transfer/

or pv

http://ivarch.com/programs/pv.shtml
 
Old 08-03-2013, 05:16 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
rsync can do local, and show --progress
but I have never really paid much attention to it, I think it might be per file and not the whole batch.

This is a script I use for sending ROM.zip files to Android.


Obviously no good for what you want, but adapt to use du instead of stat"
Code:
#!/bin/bash

TargetDir=/sdcard

for FILE in $@;do
    SIZE=$( stat -c %s $FILE )
    file=$( basename $FILE )
    adb shell 'grep -q sdcard /proc/mounts || mount /sdcard'
    echo "Pushing $FILE to $TargetDir/$file"
    coproc ADB_PUSH ( set +m
                      adb push $FILE $TargetDir/$file 2> /dev/null || \
                      echo "Error: failed"
                      set -m
                    )
    until [ "$ADB_PUSH_PID" = "" ];do
        sleep 1
        adb shell stat -t $TargetDir/$file | \
        awk '{printf "\r[ %5.1f%% ] ( %s/%s )",($2/'$SIZE')*100,$2/1024,'$SIZE'/1024}'
    done
    echo ""
done

Last edited by Firerat; 08-03-2013 at 05:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:19 PM
how to copy a directory (local) from terminal with progress bar showing Linux.Girl Linux - Newbie 6 08-19-2010 11:00 AM
copy at terminal with progress bar. DoME69 Programming 6 03-10-2009 02:41 PM
How to show a progress bar on the next line? Chowroc Programming 10 10-26-2005 11:27 PM
How the Progress Bar of a copy file/directory process is progressed?(any logic)? kiranprashant Programming 3 03-08-2005 07:16 AM


All times are GMT -5. The time now is 10:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration