LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-29-2006, 05:44 AM   #1
graziano1968
Member
 
Registered: Sep 2004
Posts: 223

Rep: Reputation: 30
how to move a directory ?


Hello

I wish to move from command line

all the files/folders contained on the folder
/usr/local/assp/extracted

to
/usr/local/assp

How to do that please ?

Thank you
 
Old 11-29-2006, 06:35 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
With the mv command, that simple.

mv /usr/local/assp/extracted/* to /usr/local/assp/

Last edited by trickykid; 11-29-2006 at 06:38 AM.
 
Old 11-29-2006, 06:49 AM   #3
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
Quote:
mv /usr/local/assp/extracted/* to /usr/local/assp/
Might like to strip the "to" from that.
 
Old 11-29-2006, 06:53 AM   #4
graziano1968
Member
 
Registered: Sep 2004
Posts: 223

Original Poster
Rep: Reputation: 30
Thank you , but I had several ".files" which were not moved (?)
Why "*" is not moving them ?
 
Old 11-29-2006, 07:38 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
OK, the following applies to bash, which is probably your shell. To check this type:
Code:
echo $SHELL
If it says something about bash, keep reading

In bash, * means 'all files in the current working directory whose name does no begin with a "."'. It's an old unix convention that files starting with a "." should be considered hidden in a superficial sort of way, and not clutter up normal directory listings. It's an entirely aethetic thing - there's no enforcement of this except that some programs respect this convention, the shell usually being one of them.

When you type a command, e.g. "mv * /some/place", it's the shell that expands this pattern and then passes the expanded list of files to the specified command, in this case mv.

If you want to specify the hidden files as well as the non-hidden ones, you could say this:
Code:
mv * .* /some/place
But there is a problem - the special directory names "." and ".." match the list .* as well as any other hidden names. "." means the current directory, and ".." means the parent directory. passing these to the mv command will result in an ugly error message.

Fortunately, bash has a mechanism for changing what * means. The shell option dotglob can be set so that * matches hidden files as well as non-hidden ones, but it won't include "." and "..", to set it entere this command:
Code:
shopt -s dotglob
Note that this will only apply to the shell in which you typed it. To make this setting work in all new shells, add it to your .bashrc file. One more thing to note - you can specify patterns to exclude from the * pattern with the GLOBIGNORE variable. See the bash manual page for more details.
 
Old 11-29-2006, 09:49 AM   #6
graziano1968
Member
 
Registered: Sep 2004
Posts: 223

Original Poster
Rep: Reputation: 30
clear , BIG THANKS !
 
Old 11-29-2006, 09:55 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by introuble
Might like to strip the "to" from that.
Heh, I hate when I type out what I'm thinking..
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using mv to move the contents of one directory into another apachedude Linux - Software 13 01-16-2009 08:57 AM
Move my Home directory... it-s Linux - General 5 07-08-2005 11:34 AM
Move home directory iain.ross Linux - Newbie 6 01-01-2005 04:37 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM
how do I move a directory in shell DKY Linux - Newbie 7 07-30-2003 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:50 AM.

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