General :: Copy The Contents Of A Txt File To Other Txt Files (with Similar Names) By Cp Command?

Jul 2, 2010

Code:
cp -r aa123.h aa*.h
results in
Code:
cp: target `aa456.h' is not a directory

Yes I read man page cp (1p). There is something written there about it, I couldn't understand though.

View 7 Replies


ADVERTISEMENT

Fedora :: Copy Files With Prompt For Similar File Names?

Nov 17, 2009

has anyone used some software tool for copying a file from one location to another (I mean local files - for example from one folder to another), which prompts if you already have this file, or a similar one...I'm going to use it for my file archive ... mostly for my MP3For example, I might have the folder /home/user/MP3/Heavy Metal/Old/Downloaded/Metallicabut have forgotten that I already have Metallica in this folder and now I want to copy my new music collection to my archive folder which contains for example this folder:MP3/Rock/MetAllicA-Full-DiscographyI need copy files software which will tell me:"You already have folder with similar name to 'MetAllicA-Full-Discography' called 'Metallica', do you want to skip this folder, or copy it to location 'MP3/Heavy Metal/Old/Downloaded/'?"This way I will reduce the file redundancy in my file archive, or at least will keep similar items close to each other ..

View 5 Replies View Related

General :: Incremental Copy Command Similar To Windows?

Jul 28, 2011

Any please help me for incremental copy command similar to windows.commad for copying in windows is c: source xcopy *.* destination /s/c/d/q/yany similar command is there in linux as I m new in Linux

View 4 Replies View Related

Ubuntu :: Only Search For Similar Case Sensitive File Names?

Jan 22, 2010

Anybody know of a way to search only for similar case sensitive files? By which I mean doing a wildcard search across a drive & the only results are like: Abc.txt abc.txt VID_001.avi Vid_001.AVI .. etc.

I've already tried searching the forums & google but the closest I've found is regarding files with increasing numbers (music_001.mp3, music_002.mp3, etc), which doesn't quite fit with my issue, as they would be seen as different files on a case insensitive OS.

View 2 Replies View Related

General :: Copy A Read-Only File And Make The Copy Writable With A Single Cp Command?

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

General :: Shell Command To Display Contents Of A File?

Feb 23, 2010

shell command to display contents of a file? Like that of .txt or .html

View 9 Replies View Related

General :: Bash Script To Categorize Folders On Similar Names?

Oct 10, 2010

Any script to categorize folders with similar name into one directory. For example: There are 4 directories named LinuxFedora, LinuxUbuntu, WindowsXP and Windows7. The script should be able to create two folder named Linux and Windows wheree respective directories are moved.

Next example: If there are many folder as below:
DevLys 010
DevLys 010

[code]...

View 1 Replies View Related

General :: Printing From Bash Shell / Concatenate Files Into One File With File Names Included?

May 11, 2011

I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.

Should I be looking to concatenate the files into one file with the file names included, and then print them?

something like: -printfunction -printername < file*

View 7 Replies View Related

General :: Display Only Permissions And File Names Using Ls Command?

Oct 18, 2010

and how to list all files in a directory including full path, owner, group and permissions for each file

View 3 Replies View Related

General :: Use The Diff Command To Get The Difference Between A String Of Text And The Contents Of A File?

Mar 31, 2010

I am not especially cli adept so could someone tell me the best way to use the diff command to get the difference between a string of text and the contents of a file instead of between the contents of two files?

View 3 Replies View Related

General :: Command Line - Show Entire File Contents In Dialog?

May 20, 2010

I want to show the contents of a file on Dialog box for which I have use the "--textbox" dialog and "--tailbox" dialog.

But it doesn't show the whole contents of file, it only shows some of the data.

How do I get it to show the entire file data?

View 1 Replies View Related

CentOS 5 :: Using Mouse & Vim To Copy Contents Of One File Onto Another

Aug 4, 2010

I am using CentOS 5.5 and openSUSE 11.0. I use vim editor but do not know more than 1 - 2% of its functionality. In openSUSE if i open 2 text files in 2 separate terminals, i can copy the contents of one file onto another by just left-clicking and dragging the mouse over the required text. But i am unable to do this in CentOS.

View 6 Replies View Related

Software :: List Files/directory Names Without Directory Contents?

May 3, 2011

When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?

View 2 Replies View Related

General :: Comparing Two Files - Display The User Names That Are In The First File And Not The Second

Sep 17, 2009

Im trying to compare two files and I only want to display the user names that are in the first file and not the second.

So I have one file named final.txt (which contains every user name and only the user names in a list no other information)

Then I have another file Over1.txt (which only contains certain users that have different permissions This file is also setup differently with the user name and some information about the user after the user name.

I need a way to compare final.txt to over1.txt so that I will only display the names that are in final.txt but not Over1.txt

Ive tried using diff and comm but just cant seem to get it two work correctly. Im not sure if im missing a option or what.

View 5 Replies View Related

General :: Create A Multiple Files By Reading A Input File And Changing The Contents?

Sep 16, 2009

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .

I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.

I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this

Before change the file looks like this

file name XYZ_111_999_YYYYMMDD_1.TXT

001,19SEP2009-14:05:05,000000003
1234
4567
6785
END_OF_DATA

[Code]....

View 4 Replies View Related

General :: Copy Mutiple Files Over Scp In One Command?

Mar 4, 2010

I have to transport a lot of files from one pc to another (both Linux). I would like to use scp for that, but scp only allows for transferring one file at a time. How can I do this?

I have No possibility to use rsync or any other protocol No possibility to use passphrase free certificates (but have a certificate with a passphrase) A list of files to transfer and a list with the destination path of the files on the other server The files are spread out over a lot of directories, and not all the files in the directories I want to copy If possible I would like to gzip and ungzip transparently to save bandwidth!

View 3 Replies View Related

General :: Copy A File From Windows With Scp Command?

Aug 18, 2010

I would like copy a backup file from image vmware linux to windows but i don't know how to process it ?i tried :scp /source/backup.tar.gz admin@x.x.x.x:/c:ProgrammefilesC:Documentsand SettingsAdminMyDocumentsbut error and i know that it's not like that, so if you have solutions

View 2 Replies View Related

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

General :: Command To Copy Files Older Than <n> Days Keeping Dir Structure?

Jul 6, 2010

I'm trying to truncate a postfix Maildata directory for one of our users. I want to be able to move any files older than <n> days to a new location, but also copying the relevant directory structure. This should be doable in the one comman. I've used find to locate the files, and mv to move them, but I can't figure out how to build the directoryt structure on the fly in the new location.

This is what I have so far:

Code:
find /Maildata/editor -mtime +42 -type f -exec mv -v {} /EditorEmailOld/ ; > ~/editor.txt

View 4 Replies View Related

General :: Copy Contents Of One Directory Into Another

Jul 7, 2011

I would like to copy the contents of a directory into another. I don't want to copy the directory and all files and directories under it, but just the contents of the directory just as if it were a regular file. Doing cp -r target dest copies the directory and the entire hierarchy rooted in it. I get error if I do not include the -r option. (I am calling cp from within a C program.)

View 3 Replies View Related

General :: Copy A Directory Without It's Contents?

Nov 5, 2009

Is there a way to copy a directory (retaining the permissions and owners) without copying the contents of the directory?

If there is no such thing... then I need a way to determine if a target path is a file or a directory, and if it is a directory I need to make a new directory elsewhere that has the same name, owner and permissions.

Basically, I'm trying write a script to copy 200 GB of files over a network to a new server, and I'd like to do it by generating a list with the find command. That way, I can migrate large chunks of the files over the course of a week, and on the day of the migration generate a new list of files that changed in the last week and then copy just the chagned files over minimizing the down time. However, the list will contain directories that I can't just use the 'cp' command on because it will copy all the contents of the directory.

View 5 Replies View Related

General :: Copy 3 Dir's Contents To 1 Dir By Crontab?

Jun 7, 2010

how to copy 3 dir's content to 1 dir by crontab?suppose i want to copy /home/ftp1/* /home/ftp2/* /home/ftp3/* to /ftpdatathree ftp user data to one folder after every one minute by crontab methodso it goes like*/1 * * * * /bin/cp -rf ??? /ftpdata

View 14 Replies View Related

General :: Command Line - Automating A Task - Copy All Subdirectories And Files From One Directory To Another

Jun 10, 2010

I need to copy all subdirectories and files from one directory to another ever 5 minutes or so, with the old data automatically being overwritten with the new data. I'd also like this to run at startup. Is there any way this can be done? If so, what program would I need to schedule the automation and what is the command line I would need.

View 2 Replies View Related

General :: Using Gnokii Utility - Copy Command As Copying Files To Home Is Not Allowed

Mar 16, 2011

iam trying to send sms using gnokii utility in linux firstly i did sudo apt-get install gnokii after that i got a gnokiirc.gz file in /usr/share/doc/gnokii/sample/gnokiirc.gz file here after that i did gunzip gnokiirc.gz then i transferred my file from the /usr/share/doc/gnokii/sample to home directory by using copy command as copying files to home is not allowed so i used sudo sudo cp gnokii /home after that i changed the port=/dev/ttyUSB2 and model=AT in the gnokiirc file in the home directory and then i wrote gnokii --identify

[Code]....

i followed as in the [URL] and [URL] and except this "Note that you will need read/write permissions on whatever serial port you specify in .gnokiirc."(iam confused what is my serial port is it ttyUSB2)

View 7 Replies View Related

General :: Copy Code From Text File To Command Prompt?

Dec 2, 2010

First I hope to undrestand my English word because Iam Arabic girl and not so good in English...

my problem is:

I wrote code in .c file and I run that code on the prompt command, its ture but I want after the out put copy the code on the command by some statment in the code , how can I do that?

View 3 Replies View Related

General :: Command Line - Move Or Copy Selected File

Jul 16, 2011

How do I move around select a file and move or copy it. All tutorials I have seen are not simple enough.

View 7 Replies View Related

General :: Capture Elapsed Time For A File Copy Command?

Jan 25, 2010

I am troubleshooting file copy time issues between 3 servers. I need to copy the same file from server A to both server B and server C and compare the elapsed times for the copy. Is there an easy way to do this?

View 3 Replies View Related

General :: Copy A File To All Subfolders In A Directory Using A Single Command?

Jul 18, 2010

I'd like to copy a file, say widgets/water.txt, to all subfolders in the folder widgets using a single command. So if the folder widgets has 10 subfolders like widgets/blue, widgets/green, etc. I'd like to copy water.txt to all of them with one command.

I tried the commands

Code:

cp water.txt ./*/water.txt
cp water.txt ./*/

However these don't seem to work. The latter gives 'cp: omitting directory' errors.

View 7 Replies View Related

General :: Copy Entire Folder Contents To Another Using PUTTY?

May 2, 2011

How to Copy the entire folder contents (including sub-folders and their contents) to another folder using PUTTY? Is there any command for that?

View 3 Replies View Related

General :: Copy Contents Of Home Directory To Other Users?

May 3, 2011

I've created other users in my machine. now I want to add all my home directory contents and settings to the home directory of other users. how can i do that? Can I do it from /etc/skel directory?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved