What Command will remove a Directory in UNIX?

Answer Posted / sambasivarao

This has two options

1) If directory is an empty directory
$rmdir <directory name>

2) If it is non-empty directory
$rm -rf <directory name>

-r means delete recursively
-f means delete forcibly.

It deletes your mentioned directory without informing
you that it is going to delete the whole directory (sub
directories and files in that directory)

J. Sambasivarao
91+ 9948280248

Is This Answer Correct ?    24 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does shebang work?

592


Is it inbetween or in between?

583


What is the significance of the 'tee' command?

596


Which unix command lists files/folders in alphabetical order?

620


How do I clear my terminal history?

586






Does cp command overwrite files?

622


Who wrote grep?

584


What are the commands in UNIX to list the files in a Directory?

620


How do you grep a case insensitive?

540


What is command statement?

543


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1762


Which command is used to restrict incoming messages?

593


What does #!/ Bin sh do?

591


What command is used to check the current users?

595


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

625