erase
the commandrmdir will not remove a directory if it is not empty in UNIX. The correct way to remove a directory and all its contents recursively is with the rmcommand.
To delete directory and sub directory in single command, use "deltree" command..
Assuming the directory is in your Home directory use: rmdir directory-name This will fail if there are files within the directory. In this case, use rm -r directory-name.
ls will list the contents of a directory.
The rm command is used to delete a file or directory. Its syntax isrm file or rm -r directoryExample:rm myfilerm -r /home/user/mystuff
Dos commands are used to create or delete directories. The ATTRIB Command is used for locking and unlocking of files.
In XP:RMDIR [/S] [/Q] [drive:]pathRD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directoryin addition to the directory itself. Used to remove a directorytree./Q Quiet mode, do not ask if ok to remove a directory tree with /S e.g.RD myfolder2will delete myfolder2 if it is empty To delete the folder with contents use the /S option.In XP:RMDIR [/S] [/Q] [drive:]pathRD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directoryin addition to the directory itself. Used to remove a directorytree./Q Quiet mode, do not ask if ok to remove a directory tree with /S e.g.RD myfolder2will delete myfolder2 if it is empty To delete the folder with contents use the /S option.
The command for deleting a file in DOS is DEL. If the file you are trying to delete is in the current directory, type DEL followed by the full filename. E.g. del file001.txt If there are multiple files, the wildcard * can be used. del file*.txt will delete all the text files that start with 'file' del file*.* will delete all the files that start with file. del *.txt will delete all the text files. del *.* will delete all the files in the current directory. It is possible to delete files in another directory by typing the full path and filename del c:\folder01\*.* will delete all the files in the directory c:\folder01\ DEL will not affect hidden files, but careless use of this command could damage your operating system so use with care.
RD command is used to remove a directory (folder).
1) When in DOS at the C:/, type RD (remove directory)2) hit Enter keyC:/C:/RDEnter
ls -lR directory
To delete all files from a diskette, you can use the command DEL *.* in the command prompt, which removes all files in the current directory. If you want to delete files without being prompted for confirmation, you can use DEL *.* /Q. Alternatively, you can format the diskette using the command FORMAT A: (assuming A: is the drive letter), which will erase all files and prepare the diskette for new data.