GCP - cp with a progress bar
hecticgeek.com
hecticgeek.com
gcp() {
cat "$1" | pv | cat > "$2"
} pv < "$1" > "$2" <"$1" pv >"$2" pv "$1" > "$2"mysqldump -u user dbname | pv | mysql -u user -h some_remote server dbname
tar c SOURCE_DIR | pv | tar xv -C DEST_DIR
or # on source computer
tar c SOURCE_DIR | pv > /dev/tcp/192.168.1.2/4567
# on destination computer computer
nc -l -p 4567 | pv | tar xv -C DEST_DIR Bash handles several filenames specially when they are used in
redirections, as described in the following table:
/dev/fd/fd
If fd is a valid integer, file descriptor fd is
duplicated.
/dev/stdin
File descriptor 0 is duplicated.
/dev/stdout
File descriptor 1 is duplicated.
/dev/stderr
File descriptor 2 is duplicated.
/dev/tcp/host/port
If host is a valid hostname or Internet address,
and port is an integer port number or service
name, bash attempts to open a TCP connection to
the corresponding socket.
/dev/udp/host/port
If host is a valid hostname or Internet address,
and port is an integer port number or service
name, bash attempts to open a UDP connection to
the corresponding socket.pv foo.sql | mysql
rsync --progress <source> <destination> rsync -rvh --progress <source> <destination>Sickness? Really? Did you come up looking for a question for which you already had an answer, and finding none, just put words in my mouth, and responded to an argument I didn't make.
What part of "just for fun" is fine with me was difficult to comprehend?
If you are going for a teaching moment, then saying "I wanted the same thing and I chose to solve it with rsync with the following alias / script" is better than telling someone they are just a waste of time.
Also, "how" matters only when I have "why" answered. If it isn't mentioned on the project page, or I skim too fast to grasp it, "why" would be the first thing on my mind.
Oh here it is http://beatex.org/web/advancedcopy.html
http://www.commandlinefu.com/commands/view/4553/copy-a-file-...
dd does not show a progress bar, unfortunately but it does report its progress.
sudo ln -s /usr/bin/gcp /usr/local/bin/cp_