# Tag Info

0

Found two ways: for file in /src/*.desktop.in; do file=${file%.in} if test -e "/dest/$(basename ${file})" then cp "/src/${file}.in" "/dest/${file}" fi done rsync and --existing: for file in /src/*.desktop.in; do rsync --dry-run --existing --verbose "/src/${file}" "/dest/${file%.in}" done 1 Assuming that with folder you mean directory and assuming you have no spaces or special characters in your file and directory names: svn st | ack '^M' | cut -b 8- | cpio -pdmv backup This is cpio in pass-through mode (-p). It takes a list of filenames to copy from stdin. -d allows it to create directories, -m preserves modification times and -v makes it ... 1 file.vdi is in all likelihood a sparse file. This is very common with virtual machine disk images: parts that have never been written to are left as holes in the file that don't consume space. You can confirm by checking whether the length of the original file matches its disk usage: ls -l file.vdi; du file.dvi I expect that ls -l will report 14GB (actual ... 0 What you have is basically as good as it gets. You can save a tiny bit of file name manipulation by changing to the directory where you're enumerating the files. It's a matter of readability, not performance. set -e cd /destination for file in *.desktop; do cp "/src/$file.in" "$file" done Don't forget to check for failures. 1 for file in /destination/*.desktop; do echo cp "/src/${file##*/}.in" "$file"; done If everything looks good, remove echo. 1 I don't think GNU cp has anything to help you if you want to see what it would do without acting. If you want to log the files that were modified, you can use the -v option: cp -puv DIRECTORYA/* DIRECTORYB >copy.log Instead of cp, you can use rsync, which is a lot more powerful and installed almost everywhere except for low-end embedded systems (and ... -1 If you wanted to run cp foo*bar whatever, then run echo foo*bar whatever instead. 1$ ssh-copy-id Usage: /usr/bin/ssh-copy-id [-h|-?|-n] [-i [identity_file]] [-p port] [[-o <ssh -o options>] ...] [user@]hostname So in your case simply use: $ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22001 user@192.168.0.1 Because of your usage of quotes, the -p 22001 part became part of the hostname which explains the error you got. 3 I'm not sure you will like this answer, but, in my experience too, using PTP has always caused a high WTF/min. Presumably the camera itself restricts writing in the root folder, or something equally sensical. I would suggest getting your hands on a CompactFlash reader, mounting the filesystem directly, and using that type of access to copy your firmware ... 0 I have done this now by these methods: Create fftp server (by installing solerwinds) on window system. login via telnet on device and run these commands: :download file: tftp -l -p Example: tftp -l desktop.jpg - 192.168.0.249 69 :upload file: tftp -l -g Example: tftp -l desktop.jpg -g 192.168.0.249 69 default location of tftp file is C:\TFTP-Root ... 0 Try with rcp command. Use man rcp for more information in case you want to automate transfers. By the way, you do know this is very insecure, right? 0 I have no ssh or ftp(or etc) on the device. So, I do next: telnet a.b.c.d | tee telnet.log login and go to the file cat file.txt close session (I close tmux pane) clear telnet.log from trash It should be easy to write utility to download/upload file over telnet 1 The simplest way would be to use zsh's numeric range glob: mv PRC<257-1516> /else/where/ The range operator matches numbers with or without leading zeroes, so PRC257, PRC0257, PRC00257, etc. are all included. You can leave the end of the range blank, e.g. PRC<257-> to move all files from 257 onwards. It doesn't matter how many files in the ... 1 Select range in braces: cp PRC{0257..1516} destination/ 1 for Host in cat servers.txt ; do scp file*$Host: ; done

2

I suppose you need: xargs -I{} scp file{01...XX} user@{}:~/ < servers.txt

1

This might help some readers: In Windows, an older, little freeware program -- Third Dir -- does exactly what's being asked for here. It's no longer available via the developer, Robert Vašíček. But I'm sure it can be found via some repositories online. Here's the developer's description, which remains on his site: Third Dir: An unusual ...

0

You can just ball a lot of files up with tar: tar -cz . | ssh me@school -- 'tar -C/path/to/target/dir -xz' ...which would recursively compress and stream all files in the current directory on the local machine to the target path while simultaneously uncompressing and expanding the stream on the remote machine. You can do similar things for anything that ...

1

You might have to use forward slashes (/) to talk with LINUX/UNIX servers c:\pscp c:\some\path\to\a\file.txt user@remote:/home/user/some/path

0

You want something like this: for dir in dir1 dir2 dir3 dir4 dir5 do cp $dir/*1155.006*$HOME done If you want to log the names of files: for dir in dir1 dir2 dir3 dir4 dir5 do for file in $dir/*1155.006* do cp$file $HOME echo "Copied$file" >> log.txt done done

1

You don't mention unmounting before ejecting the card. If that isn't an omission when writing the question, there's your problem. Writing to any kind of disk is buffered: the operating system accumulates data to write in memory, then writes it to the disk when it judges it to be convenient. The data isn't necessarily written to the disk in the same order ...

Top 50 recent answers are included