Hardware Reference
In-Depth Information
rm
Sometimes, a file or directory is no longer required and needs to be deleted. To do
this, the rm command is used.
To delete a file or folder, simply run the rm command followed by the file or
directory that you want to delete. Raspbian and most other Linux distributions
don't contain any sort of recycle bin functionality. This means that when you delete
something, it is permanently deleted.
Removing a file
There are very few things that you can do to destroy a Linux distribution.
The sudo rm -rf / command is one of them. This command will start
at the root directory and delete every file on your device, including any
files on any removable and network drives attached to your Raspberry Pi.
Needless to say, be very careful when using the -r and -f flags.
By default, when removing a directory, rm will stop if there are any files in the
directory. To delete the directory, you will need to use the -f flag in order to force
the deletion of the folder. Some of the rm command's parameters are as follows:
Option
Description
-f
This never prompts when deleting any files
-i
This prompts before deleting each and every file
-r
This recursively deletes the files and folders
mkdir
You will often need to create a new folder in order to keep your files organized. The
purpose of using mkdir (make directory) is exactly that. To use mkdir , all you need
to do is run mkdir followed by the name of the directory that you want to create.
Using mkdir
Search WWH ::




Custom Search