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.
I installed the latest CentOS 5.5 in my PC. I added some public domain projects on it. Now how can I make another boot-able CentOS iso file with all the new projects I just added? In the other words, I try to create a boot-able CD with the CentOS and all the projects on it.
just installed ubuntu couple of days back on my netbook. I am still a beginner, enjoying my adventure exploring ubuntu. I have another desktop which runs on XP. I am able to access XP shared folders through my netbook(linux). However, i wanted to copy files from XP infact folders using TERMINAL in my netbook, not copy and paste using my mouse. Are there any commands for it?
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.)
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.
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
Is there a way to copy a directory without copying the contents, but preserving ownership, timestamp etc of that directory?
I've looked at the cp man page, but I don't think it supports it. I'm thinking one would have to write a script to gather the info, and then mkdir, chown and touch. Does this seam right?
I just installed CentOS 5 and am trying to learn how to copy ISO files onto my new install, to practice network installation. The Cdrom doesn't auto mount, which isn't so bad I can mount it using :
[root@rhatserver ~]# mount /dev/cdrom /media mount: block device /dev/cdrom is write-protected, mounting read-only
My question is... I want to copy from the Cdrom... to a new folder, then practice a network install across my network. I can't seem to figure out how to do this... I know that its an ISO file. When I check the name of the file on my Debian system it lists: CentOS_5.3_Final
I created a directory ( just for practice ) calle inst on /
how do I copy that ISO file from the CDrom to the inst directory... I have tried a number of commands as root: All similar to [root@rhatserver ~]# cp -ar /dev/cdrom /CentOS_5.3_Final /inst cp: cannot stat `/CentOS_5.3_Final': No such file or directory
I even threw some video DVDs at it to make sure it wasn't the disc.
Code:
[pickens@acer1 Videos]$ dd if=/dev/sr0 of=POTC.iso dd: reading `/dev/sr0': Input/output error 5088+0 records in
[code]....
I am getting the same thing on my laptop running Mandriva, oddly enough. Two different drives, two different computers, two different distros and multiple DVDs.
I just installed a new HD on my system with multiple HD's already. I have a drive with two versions of Ubuntu & would like to copy the complete drive to the new drive along with all the contents & partitions of the Ubuntu drive.
1 - Could I partition the new drive & just copy the contents using rsync?
2 -If I copy all the contents over could I just reinstall Grub & edit fstab & be good to go?
My system is an Acer Aspire One Happy netbook. It runs Windows 7 OEM. I installed Ubuntu Netbook Remix, which works fine. Unfortunately, I put GRUB in the MBR (I wanted it on Ubuntu partition in order to use Win 7 bootloader). Acer netbooks seem to have a particular MBR (in order to run e-Recovery Management), which is different to the standard Windows 7 MBR.
Moreover, in the internet there are instruction to restore Acer MBR, but they do not seem useful, since I do not find the MBRWRWIN.EXE and RTMBR.BIN files on the hidden partition. Is there a way to tell GRUB to remove itself and restore the previous content of the MBR (something like the old "lilo -u")? Does GRUB make a copy of the content of the MBR before installing itself? Where is it, if it is so?
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?
I have a server that I wanted to transfer it to a newer one both of them have CentOS but the newer one kernel is more up to date I wanted to know is it possible just to copy some directory contents exactly to another for transferring the server data (for example /var /usr /bin /home /etc). I have one website on my server with its mysql database
I was wondering if there would be a way for me to copy the contents of a shared folder that's running on an XP system using shell script. Actually, there are two shared folders that I want to do this with. I want to be able to launch the script and automatically copy all the contents of each folder into two separate folders on my ubuntu desktop. For example;
Lets say that I have Shared Folders A1 and A2 on my networked XP system and I have Folders B1 and B2 on my Ubuntu desktop. I want the script to automatically copy the contents of A1 into B1 and likewise for A2 and B2. During the copying, I want the script set up such that any pre-existing files in the B1 & B2 folders will automatically get overwritten by the ones copied from A1 & A2.Is there any possibilities of me achieving this?
For the life of me I can not figure out what I am doing wrong with scp to copy a directory and its contents from a remote machine to my local host. I have no issues with getting a single file but would like to just save time and get the whole folder in one command.
Here is what I have tried:
scp user AT remoteMachine:/home/username/folderIwant user AT localMachine:/folderIwant this gives me a permission denied error and try again and received disconnect from localHost to many authentication failures
scp user AT remoteMachine:home/username/folderIwant . says can not find file or folder
I am sure this is something easy that I cant remember, and searches gives me local to remote not remote to local and trying to make the local to remote suggestions I read to work remote to local have not worked.
I want to design a kickstart file that creates an unattended installation (I've passed that part). After it installs, I want it to automatically read the device's MAC address and change the hostname to match the MAC address with the separators removed. (For example if the MAC address is 01-02-03-04-05-06, the prompt after login should read "root@010203040506")
I know this is entered in the "%post" section of the kickstart file, and I know I'm supposed to use the "cut" and "sed" commands, but I have no idea what I'm doing or how to do it. script so I can copy/paste it into my kickstart file?
I'm trying to view directly a partition with a damaged filesystem on it (NTFS) and so far the hex editors I tried do not do that. I tried GHex for example and it complained that /dev/sda is not a file. The partition is unmountable as NTFS however since it is damaged so I couldn't mount it first. Are there any hex editors out there that would allow me to view the contents directly and copy and paste stuff in there?
For reasons I won't get into, I need to copy directories so long as the average system load is low. Can someone help me write a BASH script that will copy the contents of a directory, but check to make sure the average system load is below X before copying each file, and if not, wait Y seconds and try again?
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.
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.
We have some large files with sampling data in it. Don't want to delete these files. But want to quickly overwrite the file with 0s and/or 1s and preserve the original file size.
Download firefox 4 from Index of /pub/mozilla.org/firefox/nightly/latest-trunk Unpack with ark to your home directry folder firefoxIn the folder firefox creat a new folder pluginscopy the contents from /usr/lib64/browser-plugins to the plugins folderStart firefox and there you go
Is there a way to recreate all the folders from one directory to another without copying over the contents of the folder? I've been trying to do something like this,
Code:for i in `ls $X`; do mkdir $PATH/$i; doneUnfortunately $i is deliminated by whitespaces in the filenames and not the actual folders.
$X contains only other folders so I dont have to worry about regular files but any kind of more "advanced" solution would work.
Now I want to append contents list2.cfg to list1.cfg(It ispposible using cat list2.cfg >>list1.cfg) but I want to check if content of (record) in list2.cfg is present in list1.cfg then dont append it otherwise append it.