Unpacking a directory into its parent directory

I've got a directory (wordpress) in a folder (the main html directory of my website) and I'd like to "unpack" it into the main html directory. That is to say, I'd like to remove the wordpress directory and have all its subdirectories be under /html/ instead of /html/wordpress/. How do I do this?

-------------Problems Reply------------

$ cd /html/wordpress
$ mv * ..
$ cd ..
$ rmdir wordpress

Do you need something more complicated?

mv /path/to/html/wordpress/* /path/to/html
rmdir /path/to/html/wordpress

Should work

mv /html/wordpress/* /html
rmdir wordpress

Category:unix Views:0 Time:2009-10-10
Tags: unix directory

Related post

  • PHP: How do I rename a directory where the parent directory is variable? 2010-06-01

    i would like to move the files inside uploads/pension/#SOME_VARIABLE_NUMBER#/#SOME_CONSTANT_NUMBER#/ here is my code: // move pension statements // located at uploads/pension/%COMPANY_ID%/%USER_ID%/%HASH% // so just move the %USER_ID% folder to the n

  • Unix zipping sub directory not including parent directory 2011-11-17

    I want to zip a sub directory and send it elsewhere, the problem I have is when I use the zip command it also includes all the unwanted layers of directories I do not want. e.g. zip -r /new.zip /Unwanted1/Unwanted2/wanted1/wanted2/file.txt ###unzippe

  • How can I load the parent directory of a script as a module, without adding all of the siblings of that directory's parent directory to my sys.path? 2010-12-23

    I'm hoping there's an easy answer to this question that I'm simply overlooking. Here's the setup: foo/ __init__.py run.py Contents of run.py: import foo Run the script: $ python run.py Traceback (most recent call last): File "run.py", line 1, in <

  • Windows cmd: Copy over entire directory *including* parent directory. Solution without specifying same parent directory name 2011-05-04

    In Windows, how do you copy an entire directory, INCLUDING the parent directory folder? For instance, let's say we have the directory c:\Folder and want to copy it over to d: . The only way right now would be: xcopy /E c:\Folder d:\Folder Is there a

  • Find MSBuildProjectDirectory Parent Directory 2009-02-05

    MSBuild 3.5 I have the following project structure: trunk/MainSolution.sln trunk/Build/MyBuild.Proj trunk/Library/... trunk/etc... So far, I've been using the following property to find out the project root folder: <RootFolder>$(MSBuildProjectD

  • Maven2 property that indicates the parent directory 2009-06-18

    I have a multi-modules project, like this one: main-project/ module1/ module2/ sub-module1/ sub-module2/ sub-module3/ ... module3/ module4/ ... I need to define a set of properties (that are dependent of the environment on which I want to release my

  • Find parent directory of a path 2009-08-21

    Is there any way to find the parent directory of a path using NSFileManager or something? e.g. Take this: /path/to/something And turn it into /path/to/ Thanks --------------Solutions------------- The NSString method -stringByDeletingLastPathComponent

  • changing to parent directory in unix 2009-12-09

    in general we use cd .. for going to the parent directory cd ../../ to go to the parents parent directory. and cd ../../../../../ for 5th parent directory. is there any simplified way of doing this? shell i am using is ksh. --------------Solutions---

  • Get parent directory of running script 2009-12-10

    In PHP, what would be the cleanest way to get the parent directory of the current running script relative to the www root? Assume I have: $_SERVER['SCRIPT_NAME'] == '/relative/path/to/script/index.php' Or just: $something_else == '/relative/path/to/s

  • nAnt script needs to get parent directory 2010-02-05

    I am writing a nAnt script and need to get the parent directory. I have used: <property name="perforceWS" value="${project::get-base-directory()}"/> this returns the current directory. How can I get the property to be the parent's directory? --

  • Get parent directory name for a particular file using DOS Batch scripting 2010-03-07

    I need to find the name of the parent directory for a file in DOS for ex. Suppose this is the directory C:\test\pack\a.txt I have a script which asks me the file name C:\\>getname.bat enter file name: c:\test\pack\a.txt now the script should retur

  • Display contents of a file in the parent directory 2010-03-21

    I have a command which lists Weblogic instances directories on a server.I want to display contents of a file in the parent directory of each directory listed. An additional feature would be to display the name of the file in addition to displaying th

  • How can I use mod_rewrite to redirect children pages/directories to a parent directory? 2010-04-16

    So I have a whole series of redirects in place for a bunch of pages I want redirected to their parent directory (e.g. /faq/question1/ -> /faq/), but it's very inflexible, as they're manually generated. How can I set up a RegEx-fueled RewriteRule f

  • Why does Gnumake from parent directory behave differently? 2010-04-22

    I am stumped as to why when I do a gnumake from the parent directory it behaves incorrectly, whereas, if I cd to the subdirectory and do gnumake it works correctly. In the parent makefile, I have a rule like this: .PHONY: zlib-1.2.5 zlib-1.2.5: @ ech

  • How to open a file in the parent directory in python in AppEngine? 2010-05-02

    How to open a file in the parent directory in python in AppEngine? I have a python file module/mod.py with the following code f = open('../data.yml') z = yaml.load(f) f.close() data.yml is in the parent dir of module. The error I get is IOError: [Err

  • How do I get the parent directory in Python? 2010-05-18

    Could someone tell me how to get the parent directory of a path in Python in a cross platform way. E.g. C:\Program Files ---> C:\ and C:\ ---> C:\ If the directory doesn't have a parent directory, it returns the directory itself. The question m

  • How to use the .* wildcard in bash but exclude the parent directory (..)? 2010-05-26

    There are often times that I want to execute a command on all files (including hidden files) in a directory. When I try using chmod g+w * .* it changes the permissions on all the files I want (in the directory) and all the files in the parent directo

  • Referencing a file in a parent directory 2010-05-29

    Is this the right way to go about referencing a file in a parent directory relative to a php source file?: require_once('../referenced_file.php'); --------------Solutions------------- To include a file relative to the current source file you should u

  • URL rewriting from root to parent directory 2010-06-23

    I need to write a rule to redirect a page to a parent directory in a .htacces file. For instance, this is my files system : - a-directory - another-directory -- a-file i've got a virtualhost which is a pointer to "a-directory" so when i go to http//m

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.219 (s). 11 q(s)