• Skip to primary navigation
  • Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives
  • Contact

Moving Linux Directory

by Ulysses · Jun 17, 2019

Moving a Linux directory the safe way.

cd /mydir ; tar cf - . | (cd /data/mydir ; tar xf -) ; mv /mydir /mydir.0 ; ln -s /data/mydir /mydir

cd /mydir ; tar cf - . | (cd /data/mydir ; tar xf -) ; mv /mydir /mydir.0 ; ln -s /data/mydir /mydir

Filed Under: Linux Tagged With: directory, moving, safe

Subscribe

Copyright © 2012–2021

  • Cloud
  • Linux
  • Git