How to delete a file in ubuntu terminal?

2 answer(s)
Answer # 1 #

Be careful: rm does not move files to trash, it deletes permanently. Use -i for interactive mode:```bashrm -i filename.txtrm -rf /path/to/directoryThe -r flag is recursive, and -f forces deletion without prompt.

[3 Month]
Answer # 2 #

To delete a file in Ubuntu terminal, use the rm command:bashrm filename.txtrm file1.txt file2.txt file3.txt

[4 Month]