4

I need to get into the root directory to delete a file. How do I get there?

3 Answers 3

8

This will get you to the root from command line:

cd /

If you are using ftp it might go to the root of your ftp (not per definition the root of your system).

I would be careful if I was you: in general nobody creates files in "/". Removing needs to be done with sudo in front of the rm and you need to be using an admin account.

1

From a cli/terminal you can use the sudo command to assume root privileges, which you need to delete stuff from your root directory. If you're unfamiliar with cli commands you issue the command gksudo nautilus to open the file browser with root privileges. Do be carefull when deleting stuff in the root directory or you might break your system.

1

Assuming you are using the graphic desktop

  • click on the icon top left to open a "search" bar. Type "term" - short for terminal.
  • Once the terminal window opens enter cd / (as mentioned above)

To delete files I would suggest using

rm -i /yourfilename /your/file/name

so that you can preview what is getting deleted - especially when using a wildcard (* and/or ?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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