I used command scp text.txt root@*.*.*.*:/~ to move text.txt file to home directory of my server. but it instead make a ~ directory in / of my server I can't either remove or access it because when I run command cd /~ it assume it as cd /home/username.

  • you should probably boot to a live cd and delete it that way .. that would probably be the easiest way.. you could do it from a file browser in the live cd .. just launch it using sudo so it runs as root then you can just right click and delete the offending folder... actually you probably wouldnt even have to run as sudo .. you could probably just delete it from the live cds file browser
    – John Orion
    Jun 1, 2016 at 2:53
  • not sure if it would work or cause issues but you could probably just cd to / then remove ~ without using /~ of course as sudo to remove it .. tho i feel that using the live cd is the best option .. i would hate for the removing of ~ to cause other files needed to be deleted somehow .. with the live cd method I know that only the one folder will be deleted
    – John Orion
    Jun 1, 2016 at 2:59

1 Answer 1


O.k. assuming you want to keep that file/directory, first rename it to something more normal by:

# note you need to escape the ~ to make this work
sudo mv /\~ /text.cipher

Then you can either copy it away where you want it or remove it with:

# -r flag only if it is a directory
sudo rm -r /text.cipher

This is the safest way to approach it actually after the renaming you can check if it really was that file which got renamed or if you unintentionally renamed your user directory.

More information here

  • This option could work..
    – user527600
    Jun 1, 2016 at 3:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.