LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-23-2011, 06:38 AM   #1
cnt
LQ Newbie
 
Registered: Aug 2011
Location: cg,india
Posts: 20

Rep: Reputation: Disabled
command to cut all file and dir


is their any command like mv to cut and paste all files and dir and their sub-dir . so if destination contain same dir/file will get over written and update also.

i used mv -fv rakesh /fsdisk/monthly/home/rakesh
mv: cannot move `rakesh' to a subdirectory of itself, `/fsdisk/monthly/home/rakesh'

i need to move all file/dir whatever destination had.
 
Old 08-23-2011, 07:43 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
When you have a directory that you want to either copy or move from one place to another the form of the command, using your example, is
Code:
mv rakesh /fsdisk/monthly/home
That is, the directory rakesh will be moved to /fsdisk/monthly/home/rakesh.

You may want to take a good look at the mv manual page; the -u option may be of interest.

Another option is to use cp rather than mv:
Code:
cp -pr rakesh /fsdisk/monthly/home
-p preserves mode, ownership and timestamps and -r does a recursive copy; i.e., it will copy an entire tree.

Hope this helps some.
 
Old 08-24-2011, 05:59 AM   #3
cnt
LQ Newbie
 
Registered: Aug 2011
Location: cg,india
Posts: 20

Original Poster
Rep: Reputation: Disabled
when same dir present at destination is messages mv : omitting 'rakesh'
only dir get copy not it files and subdirectories
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO cut an arbitrary portion of an mp3 file on command line wheeliee Linux - General 2 05-07-2010 08:20 AM
help with cut command using find. Cut last 8 characters leaving the rest ncsuapex Programming 4 09-16-2009 08:55 PM
How to use command grep,cut,awk to cut a data from a file? hocheetiong Linux - Newbie 7 09-11-2008 07:16 PM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration