Originally published at: https://www.cyberciti.biz/faq/howto-linux-unix-delete-remove-file/
How do I delete a file under Linux / UNIX / BSD / AIX / HP-UX operating system using command line options?
Command to delete file is “rm”.
rm <filename>
deletes the file without asking anythingrm -i <filename>
asks before deleting file.rmdir <dirname>
is used to delete an empty directory.rm -r <dirname>
delete a directory with all the files in it including all sub-dirs.man rm
andman rmdir
to read help pages about rm and rmdir.