Linux Command to Delete All Files in a Directory (LCDAFD)


LCDAFD:   SOLD       




I want to delete all files from a directory. Can you tell me the Linux command to remove all files in a directory?

You can delete all files in a directory using the unlink command. Another option is to use the rm command to remove all files within the directory. This page explains how to delete all files in a directory using command-line options.

Procedure to Delete All Files from a Directory:

  1. Open the terminal application.
  2. To delete everything in the directory, run:
    rm /path/to/dir/*
    
  3. To delete all subdirectories and files, run:
    rm -r /path/to/dir/*
    

Post a Comment

Previous Next

نموذج الاتصال