Software & Apps Linux How To Delete Files And Folders Using Linux Use the 'rm' command or your desktop environment's graphical tools by Gary Newell Writer Gary Newell was a freelance contributor, application developer, and software tester with 20+ years in IT, working on Linux, UNIX, and Windows. our editorial process Gary Newell Updated on February 19, 2020 Linux Switching from Windows Tweet Share Email With Linux, use either your desktop environment's graphical tools or the rm command from a shell prompt to delete files and folders. The benefit of the GUI relates to ease-of-use, but each DE's file manager functions slightly differently. The rm command functions similarly across all distributions, but it works from the shell prompt. Deleting Files and Folders Graphically Although each desktop environment uses slightly different metaphors for file access, in general, you're generally free to delete files and folders by either: Clicking the object then pressing Del.Right-clicking the object then selecting the Delete or Move to Trash option, or its equivalent. In the GUI, by default, deleted files and folders move to the Trash folder, from which they may later be recovered if you deleted them accidentally. Removing Files from the Shell The rm command works from the shell prompt; its usage is the same regardless of your distribution or your desktop environment. By default, the command looks like this: rm file-to-delete Command Options for 'rm' The rm command accepts several options that influence how it executes: -f: Ignores (force) non-existent files and arguments without prompting for confirmation.-i: Prompt before each object deletes.-r: Remove directories and their contents recursively.-d: Remove empty directories.-v: Display progress with verbose notifications.--help: Displays a summary of the command's syntax and usage. Tips The rm command's delete capability does allow for file recovery with sufficient time and skill. To remove files permanently, use the shred utility. From the shell prompt, rm supports wildcard patterns. Thus, to delete all files with a PDF extension, type: rm *.pdf In addition, rm unlinks hard and soft links. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up. Tell us why! Other Not enough details Hard to understand Submit