[LINUX] [Ubuntu] How to delete the entire contents of a directory

rmdir -r cannot be used

If you try to use rmdir -r, which is often used on CentOS etc.

$ rmdir -r test/
rmdir: invalid option -- 'r'
Try 'rmdir --help' for more information.

I get angry if I don't have the option.

Execution method

I settled down by deleting the contents of the folder → deleting the directory.

Delete the contents of the folder (including the directory)

$ rm -r ./*

Delete directory

$ rmdir test/

Recommended Posts

[Ubuntu] How to delete the entire contents of a directory
How to connect the contents of a list into a string
How to calculate the volatility of a brand
[Introduction to Python] How to sort the contents of a list efficiently with list sort
How to access the contents of a Linux disk on a Mac (but read-only)
How to get a list of files in the same directory with python
How to see the contents of the Jupyter notebook ipynb file
How to find the scaling factor of a biorthogonal wavelet
How to delete a Docker container
How to determine the existence of a selenium element in Python
[EC2] How to install chrome and the contents of each command
How to check the memory size of a variable in Python
How to check the memory size of a dictionary in Python
[TensorFlow 2] How to check the contents of Tensor in graph mode
How to find the memory address of a Pandas dataframe value
How to output the output result of the Linux man command to a file
How to get the vertex coordinates of a feature in ArcPy
Create a function to get the contents of the database in Go
[NNabla] How to remove the middle tier of a pre-built network
[Python] A program that rotates the contents of the list to the left
How to check the version of Django
The story of adding MeCab to ubuntu 16.04
[Ubuntu] How to execute a shell script
Get the filename of a directory (glob)
How to compare if the contents of the objects in scipy.sparse.csr_matrix are the same
[NNabla] How to add a quantization layer to the middle layer of a trained model
How to put a line number at the beginning of a CSV file
How to create a wrapper that preserves the signature of the function to wrap
How to play a video while watching the number of frames (Mac)
A simple example of how to use ArgumentParser
How to find the area of the Voronoi diagram
How to copy and paste the contents of a sheet in Google Spreadsheet in JSON format (using Google Colab)
How to read a file in a different directory
How to mention a user group in slack notification, how to check the id of the user group
[Circuit x Python] How to find the transfer function of a circuit using Lcapy
[NNabla] How to get the output (variable) of the middle layer of a pre-built network
How to count the number of elements in Django and output to a template
[python] How to sort by the Nth Mth element of a multidimensional array
A memorandum of how to execute the! Sudo magic command in Jupyter Notebook
[Numpy, scipy] How to calculate the square root of a semi-fixed definite matrix
How to make a Raspberry Pi that speaks the tweets of the specified user
[Introduction to Python] How to get the index of data with a for statement
Read the Python-Markdown source: How to create a parser
How to write a GUI using the maya command
Template of python script to read the contents of the file
How to delete the specified string with the sed command! !! !!
How to get the number of digits in Python
A memo of how to use AIST supercomputer ABCI
A memo to visually understand the axis of pandas.Panel
How to know the current directory in Python in Blender
How to create a submenu with the [Blender] plugin
[Reintroduction to python] How to import via the parent directory
How to visualize the decision tree model of scikit-learn
How to write a list / dictionary type of Python3
Try to get the contents of Word with Golang
Steps to calculate the likelihood of a normal distribution
[Blender] How to dynamically set the selection of EnumProperty
Basics of PyTorch (2) -How to make a neural network-
[Python] Summary of how to specify the color of the figure
How to hit the document of Magic Function (Line Magic)
How to access the global variable of the imported module