General :: Syntax For CP - Making Virtual Move To Directory
Jun 13, 2011
I just joined LinuxQuestions and find no Forum specific to command-line syntax questions, so I'll post it here. Here is the question. I can use:
cp -vr --parents /a/b/c/this /x/y
to create a directory /x/y/a/b/c/this containing this and everything under this.
But how could I create a directory x/y/b/c/this (ie omitting a)? I could MOVE to /a/ and then use
cp -vr --parents b/c/this /x/y
but I really don't want to do the MOVE (and can think of circumstances where I might not be able to).
I'm really looking for something exactly similar to the
tar -C DIRECTORY
switch that allows one to make a virtual move to the directory DIRECTORY before commencing the tar operation.
I would like to split my display in two, so they would behave like two physical monitors, i.e. it would be for example like to connecting two 960x1080 monitors through physical ports. Is something like this possible? The problem is i would like to run two fullscreen applications on second monitor. Is that even possible? I prefer Windows 7/vista but I welcome Linux solution as well
I have been playing around with the tar command and I know this is how to use it. Code: tar -cf [filename] [directory] But what I want to make an archive from the current directory I thought just to not enter a directory but that doesn't work. I get an error about creating a empty archive so how to do I make it so how do I tell it to do the current directory?
When installing Ubuntu (10.04) I chose the /home to be installed in a separate partition.I would now like to move the /srv directory into the same partition. The problem I found is that Ubuntu did not make a /home directory inside the partition itself. It just places the account directories in the partition and mounts it to /home. So I cannot just easily move the /srv folder into the partition.
How can I:
Move those account directories into a home folder inside the partition Make that new home folder the default /home folder. ditto with the /srv folder, or any I choose in the future.
I have a directory , there are many files created in it , I want to use the command to move the files which elder than 30 days and gzip it and then move it to /tmp , and then remove those files , I tried use below command but not work.
find ~path -type f -mtime 30 -exec tar -zcvf - {} --remove-files > /tmp/oldfile.tgz ;
The *.dbf files (DBase III Plus files) have a header (metadata) and follow with n fixed records. I'd like to make a directory entry (like a symbolic link) that point to the fixed record area into a .dbf file. Is it possible in linux? The request is motivated by access a .dbf file from a Firebird SQL Database using CREATE TABLE EXTERNAL FILE '/tmp/mydbf.dbf' ( ... ); but this command only works on fixed records.
When ever i open vim, i get the error that the following error: E484: Can't open file/abcd/configFiles/vim/syntax/syntax.vim There was a .vimrc file in my home folder that i have removed.
Still i keep getting the same error. Presently in my home folder there is no .gvimrc or .vimrc file.
But still i keep getting the same error. I am not too sure where this file is mentioned.
Background info: The SHELL has been changed from tcsh to bash Earlier i had created a .vimrc file in tcsh, i have removed the .vimrc in bash SHELL.
I have a php script in cron directory that generates 5 textfiles, after the files are generated, I want to create a script that will move the 5 text fiels to anoher folder name "web".
I created a partition in my hard disk for my data (documents, multimedia, etc.).How can I:Move the /home/ directory to the new partitionMake the OS (Ubuntu Linux) treat that directory as the default /home/.
I am trying to clean my computer. Basically I try to order some movies to put all of them in directories. I started by hand but I am loosing time I guess. I want to do something like:
mv *.avi /nonexisting_directory/
nonexisting_directory being the name of the file without .avi, changing for each file. How can I write in command lineor in script?
I am new to linux and wget...what would be the syntax to use wget to move content from one local directory to an svn repository (svn commit)? For instance if i have a directory c:\dir1, and i want to move it's content onto an SVN repo...is this possible using wget? If so, how do I get this done?
In order to protect myself if I make a mistake in typing a directory/filename path, I am searching for a way to prevent mv from doing anything if the source and destination files exist on separate partitions.I see no options in the man page.I just need to find a way to get the partition the directory/file is on
the system currently have a directory with all the invalid files. how bad is it to move a single file to a directory containing 3 million files already?
I've had enough with the malware that finds it's way into Windows. I currently have our home desktop (WinXP) which is plugged into our high speed cable modem. We also use a laptop (Windows Vista) downstairs which currently shares the internet wirelessly from our main desktop upstairs. Whenever we want to view pics, listen to music or surf the web, I just plug in my wireless router which is connected to the cable modem and my XP box.
How is it that I can still view my desktop's pictures, listen to my desktop's tunes and surf the web on my Vista laptop downstairs once I install Ubuntu on my desktop?
I'm sure I've done this before and am having a brain fart.
I have run into this a couple of time this last month:
I have a list of torrent files (blahblahhexblah.torrent) saved in a text file. I would like to read the text file and populate the client directory.
I can echo the file using:
But I cannot remember how to pipe the output into the directory, nor can I find any resources that describe the process.
Interestingly enough, I've had a couple of opportunities to do similar tasks with passwords and privileges and even across the LAN in the last few days. Solving this problem will help me solve the others for next time.
I'm looking for a script that can be run regularly with Cron.
Check a folder for Rar files every few minutes, Unrar if present, and delete the left over files once done.
Be able to specify the directory of which folder to watch within the script.
Run an extension white list (.avi, .mkv, .mp4) and blacklist (rar files) of files to be moved.
Specify within the script which folder to move found files to.
I've seen a few online that does some of this or much more than this but I'm looking for something that just does this in a simple and efficient way... (Also for the life of me, I just can't get how to edit this to do what I'm looking for)
I need little help. I want to find all files with extension "*.tar" "*.gz" and "*.zip" and move all those files into "/opt/old" directory. I've tried this command:
I came from the Debian world so I did not do much building software from source. I successfully built wine from source, now the wine binary is in the same directory where the Makefile and all of the other source stuff is. I can run wine from that directory fine, but I sort of want to move it somewhere else. I tried moving the wine binary somewhere else, but when I try to run it I get
[code]...
What all do I have to move into the new directory to get wine working in the new directory? By convention, where should I move wine, I want it available for all users, should I move it to /opt/wine, or /usr/local/wine, or somewhere else?
If I want to share a directory called /home/me, would I go to my /etc/exports file and share /home/me/* or would I share /home/me ? I am unsure of how to type this into the file.
I am a Novell (now defunct) CNE tring to learn Linux and am having a lot of trouble finding out where the WB 6-6 is wrong in the syntax for adding local4... the the syslog-ng config file. In the instructions there are discrepancies between commas and simi-comma, they are both in the statements in no particular order. there is no pattern to them. Here is what the book shows:
filter f_local4debug { level(debug) and facility(local4); };
When I try to input this in the Gnome terminal window to try and find out where it goes wrong I get the following: -bash: syntax error near unexpected token "(" If I can get the correct syntax I belive I can use the info to get past the rest of this portion of the lesson. I am desperate to learn Linux as the only jobs out there for a Novell CNE are migrations to MS, which really sucks, since MS really really sucks.
Hello, im running ubuntu 9.10 on my laptop and im trying to make a win xp vbox and when it gets to the part where is is creating the virtual hard drive (30GB in my case) it just stays at 0%. I left it running last night and went to bed, in the morning it was still at 0%. Now iv just tryd it again and its been sitting for about 2 hours now and still at 0%.
Installed linux mint in a virtual box (ose).Only problem,can't get the cursor out of the window,thus unabling me to unmount the iso so keeps reinstalling.Does anyone know how to set it so I can get the cursor to move outside the virtual box.
I currently know how to run a traffic report on the whole host. How can I setup a cron job to run the report on a paticular virtual host and move it to the directory where it can be view over the net?
I am running Ubuntu Studio 9.10 on Microsoft Virtual PC. After using it a lot, I have decided to move to a real machine. The thing is, I don't have the time to reinstall ubuntu and all the programs and move my docs.So i wanted to copy/move the content of my virtual HDD to put it on a real one. But when I try copying th e OS, it says that i don't have permission to do that. What can I do?
After upgrading my Debian from Lenny to Squeeze a few things don't work properly. Most disturbing is that after one switch from graphic screen (x, Gnome) to the virtual consoles this can be observed:
1) The virtual consoles show only a small font. It doesn't change when I use 'dpkg-reconfigure console-setup'. Otherwise everything seems to function properly, but then
2) I return to x (with Alt+F7), and if I again want to reach the virtual consoles (with Alt+String+F3, this is a laptop) the screens are persistently black; nothing works, except Alt+F7, which allows me to go back to the x-screen. In this graphic screen it is possible to use the consoles without problem.
3) I have some trouble shutting-down the computer. The screen disappears, everything goes black, but the computer goes on and does not shut down until I press the power-button, forcing the shut-down process. If I press the keys which would bring the computer to a halt through the virtual consoles, I can bring it to stop allthough the screen remains black throughout the whole process. I press: Alt+Strg+F3 to reach the consoles, there 'root + password', Enter, halt, Enter. Nothing at all appears on the screen, but after a while the computer stops.
I am trying to move all the txt files with a script from multiple directories to one directory, adding the parent directories of the files to the file names.It's a little complicated to explain, but i hope the script i have so far explains what im trying to do better: