I am trying to write a shell script that deletes a persistent but unnecessary folder in my home directory upon execution. So, I ask you fellow Ubuntu users, what is the terminal command to delete a file/folder?
Asked
Active
Viewed 1,557 times
-1
-
No, I want the terminal command to delete a file in general. But I'll check it out. – It's Willem May 08 '15 at 00:44
-
in case of a file use `rm`, in case of a directory `rm -r` (if empty `rmdir` will work) – heemayl May 08 '15 at 00:46
-
This link might be what you're after? http://askubuntu.com/questions/217893/how-to-delete-a-non-empty-directory-in-terminal – May 08 '15 at 00:47
-
That gave me my answer! – It's Willem May 08 '15 at 00:54
1 Answers
0
The Command rm
if you want to remove a directory you need to use rm with option -R
rm -R
check the option for rm
by typing rm --help
Mike
- 21
- 2