General :: Copy Only New File To Other Location?
Jul 19, 2011
I am a fresher in shell script, I want to copy only new file in a directory to some other location. I am able to find new file using
"ls -ltrh | tail -1", it is showing new file. But I don't know how to add in the shell script to copy that new file to other location.
View 7 Replies
ADVERTISEMENT
Nov 29, 2010
File is named similar to : logout 10.10.10 100817.txt
I need to copy this to a new directory.
To fine the latest file I was advised to use code...
View 3 Replies
View Related
May 17, 2010
I want to copy location of every .avi , .jpg file present in a folder or in subfolder present in a direcotry and save in a textfile how to doex : /home/username/Desktop/bookofeli/video/book.aviit should give full locaiton of path how to do
View 2 Replies
View Related
Jul 10, 2011
I downloaded the bin file, and installed it but I haven't realized that I made the folder in the current directory. I would like to install in /usr/java.
Can I now just copy paste it there. Or I need to re-install to desired location I installed JRE , is that ok or I need to install sdk
View 1 Replies
View Related
Nov 5, 2010
I am attempting to copy a set of sub folders from their multiple parent directories to a new location.
For example, I have three folders to copy:
I would like them to be copied to:
In actuality there are many folders besides folder1, folder2, folder3, and no numerical order exists. So, the folder named 'photos' would be copied to its parent folder's name in a new location. I would need this to occur for all folders in the '/home/user' directory.
View 6 Replies
View Related
Mar 1, 2011
How to copy a Read-Only file in Linux and make the copy writable with a single cp command in Linux (Ubuntu 10.04)? The --no-preserve and --preserve seemed to be good candidates, except that they should "and" the mode flags, while what I am looking for is something that will "or" them (add +w mode).
More details: I have to import a repository from GIT to Perforce. I want that all Perforce depot files are Read-Only (that is how Perforce was designed), while all other files that were derived/copied from depot files are writable. Currently if a Makefile tries to copy a Read-Only file then the derived file will also be Read-only. This leads to build-errors when cp tries to overwrite Read-Only file second time. Of course the --force is a workaround here but then the derived file is also Read-Only. Also I do not want to mess with "chmod" after each "cp" command - I will do that only as the last resort.
View 1 Replies
View Related
Jan 30, 2010
When I use ldd it prints the location of the depends.Is there a way to copy the depends listed to a location in a single command or streamline it? I don't want to copy each dependence once at a time.
View 1 Replies
View Related
Dec 12, 2010
How can I set my log files to copy themselves to a different location every, say, two weeks? Thanks in advance.
View 1 Replies
View Related
Jul 18, 2010
rather after I have had no problems installing 11.3 on a new hard drive, , can I simply mount the old one and copy libdvdcss to the same location on the new drive, or does it need to be "installed"?
View 5 Replies
View Related
Jun 15, 2010
I have a file in some obscure directory that I want to open and edit. I don't want to do something like this...
vim ~/foo/bar/blah/doh/ugh.txt
I'd rather be able to say find this file and open it. I know there are commands like locate and find to find a file or directory, but I'm not sure whether these can (or even should) be utilized in what I'm trying to do. Basically, what is the simplest way to open a file with a program w/o specifying its exact location? (In cases where there isn't another file with the same name in the entire system, and cases where there are multiple).
View 3 Replies
View Related
Jun 5, 2011
Let's say we have machine 1 and machine 2. Machine 2, which is linux based, is receiving a file (let's say cat.jpg sent via SCP from machine 1 (doesn't really matter which operating system..) How can I know in machine 2, that the file has finished uploading from machine 1 ? Please note that by "knowing" I mean by running a command (via a cron that runs every minute), and not by an event driven way ("make the scp issue a command when it is finished uploading"). Another limitation I have is that I can't change anything in machine 1 or in the way it SCP files.
If it really matters: the files being transferred are video file, MP4 extension. machine 2 is ubuntu 10.10
View 5 Replies
View Related
Jun 14, 2011
I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash.
I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also need to keep the order intact after copying.
For e.g - If I get a JPG file under /home/usr/new/1/ then the destination also needs to be /test/old/new/1/.
At the moment, I am simply putting all files under /test/old/ and I can't somehow get the later /new/1/ folder path created under /test/old/
I understand this could well be done using while OR if else loop, though if someone can just guide me with a hint, I would be really grateful.
I will complete the rest of the steps and was asking here since I am still not comfortable with the shell/bash scripts yet and planning to be really good at it over the next couple of months.
View 1 Replies
View Related
Jun 3, 2010
I had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script..I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell...But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank..
View 1 Replies
View Related
Oct 30, 2009
I am using linux machine and execute a command vm-install to perform some operation. How would I find the exact location of this file.
View 1 Replies
View Related
Nov 16, 2010
I have an embedded linux system (Debian 'Lenny') which booting from a microSD flash. If I make a copy of a file on the flash file system (cp test test1) and then power off (disconnect power spontanious). Connects power again and the system come up, but the file test1 is gone. How can I secure that test1 is NOT disappear if the power get lost?If I copy file and then restart system with reboot command, the file test1 does not disappear.
View 7 Replies
View Related
Sep 19, 2009
favor and let me know how can I copy some text in one file and paste it to another file ,when both of the files are being opened by vi text editor ?
View 7 Replies
View Related
Oct 18, 2010
I have a C-function that create a file and then make a copy in the same directory, but somethin is wrong with permission or owners.The program starts as root user.The file creates by the program:
-rwxrwxrwx 1 root staff 199680 Oct 18 10:58 test
Ok, but after copying the permission is not the same.The file after copying (with new name) by the program:
-rw-r--r-- 1 root root 199680 Oct 18 10:58 test_copy
I want to have full permission of the copy, how to do??
View 2 Replies
View Related
May 24, 2010
I am using ubuntu 8.04. I played an mp3 in totem & meanwhile moved that file to another location. Still I can move slider in totem to rewind or forward the song. Only after the song has been played completely I get message 'location not found'. Does that mean totem copies song into RAM so that it does not have to trouble hard disk for access during entire duration ?
View 2 Replies
View Related
Feb 1, 2011
I was trying to install vmware player 3.0 and it prompt that it require the kernel kernel-2.6.35.6-45.fc14.i686 to be compile before it start.
Quote:
Kernel headers for version 2.6.35.6-45.fc14.i686 were not found. If you
I try following but unable to find.
Code:
Nothing to do
Code:
Code:
Then I try to map to the file, but not working.
View 3 Replies
View Related
Oct 1, 2010
When i do cp filename destinationfolder it isn't happening. I don't get any error messages or any indication that the file copy didn't happen. But when I go to the destination folder and do ls; the file(s) not there. I tried it with sudo also and i get the same results. When I first did the copy it actually copied it somwhere but not where i wanted it. It copied it to folder name Desktop. So i tried copying it from Desktop and again same results.
View 3 Replies
View Related
Jun 23, 2010
I m trying to take backup of a file using ssh.I have written a command like following.Which will take backup of vm.cfg as backup.cfg...How would i modify my query?
View 2 Replies
View Related
Feb 26, 2011
I'm using ubuntu and I'm trying to copy a .iso file to a dvd. I have k3b at my disposal. My problem is that the dvd is not empty, and I'd like to overwrite it or wipe it before copying the new .iso, but k3b displays an error if I try to overwrite it, it says it doesn't have the necessary rights and proposes me to use k3bsetup. I have it too, but I don't know how to use it.
View 8 Replies
View Related
Apr 4, 2009
I am developing a Web-based application and have some folders that will generally reside outside of the Web accessible area of the server. However, since some people will not be able to store those folders outside of the "public_html" folder, I am looking to put a blank "index.php" inside of every folder within that section of the application. To make things easier, I would like to know if there might be a way to recursively copy one file into every folder in a certain location.
In other words, is there a command that might do something like:
Code:
> cp -R index.php /home/user/public_html/source-files/*
Basically, I want every directory inside of "source-files" to get a copy of "index.php". The directory hierarchy within "source-files" can go at least three or four levels deep, so the command would need to be recursive. I am looking for a command-line statement that I can type to perform this action.
View 3 Replies
View Related
Aug 24, 2011
I want to transfer a huge file (60GB) over the NFS network on linux. Is cp the best option?
View 1 Replies
View Related
Mar 26, 2010
I'm trying to copy a 6Gb file across from my laptop to an external usb drive but it quits at about 4.2Gb every time with a "file size limit exceeded" error. i have checked the output of ulimit -a and there is no limit there on the file size. I'm using the Slax live Cd for this as it always gets the job done
View 8 Replies
View Related
Nov 29, 2010
how can I copy a file into the root. I am new to linux and using fedora 13. I have to install jdk on the linux.
View 6 Replies
View Related
Feb 27, 2010
Firstly, I did perform a search on this problem in these forums, but didn't quite get what I was looking for. So I hope I don't yelled at for making a duplicate post. So I used rsync to backup my webroot to another nix machine. du -hs gave me 1.3 G on the source machine and 1.1 G on the backup machine. I tried to compare the individual files and noticed a trend. The files on backup machine were always smaller than the files on source machine. The source uses SATA drive, destination uses IDE. So this time I rsynced locally to another folder on the source machine. Same size anomaly. So i did a simple cp file ~/file and same size anomaly. So it's not a rsync issue.
I took a file and ran md5sum on both, the source file and destination file. To my surprise, even though the file size was different, they had the same md5sum. Now, let it be known that the source machine is a production server and the dir i rsynced was being used, serving pages to the web. I googled about this and came up with stuff like open descriptors and holes. I don't understand this stuff and was wondering if this was really the case. What are those if it is the case? And my backup copy is 100% identical right? There are thousands of files and I ran md5sum only on couple. Can I take comfort that when time comes, I can restore using my backup without any problems?
View 3 Replies
View Related
May 6, 2011
I am currently using debian 6.0 .While moving the file , electricity vanished. It happened that the file being moved wasn't at source neither destination folder.Is there a file copy program which works atomically (like teracopy in windows) .Yeah , common sense would be to manually copy then delete file from source . Can't this be integrated into GUI by a program?
View 12 Replies
View Related
Oct 31, 2009
How do copy a file from one location to another using python script? How do i execute the shell script within python script?
View 1 Replies
View Related
Dec 25, 2010
how to copy a file in puppy linux?
View 1 Replies
View Related