How to remove all files from a directory in Ubuntu using command line?

To remove everything in a directory use:

rm /path/to/directory/*

You can use the -r option, for example:

rm -r /path/to/directory/*

If you want to remove the entire directory with all the files within it just use the following:

rm -rf /path/to/directory