nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

delete directory linux

This is a discussion on delete directory linux within the Linux software forums, part of the Linux Getting Started category; hai how do i delete directory in linux? Following command is not worlking for me.. Code: rm directoryname thank...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-21-2006, 08:18 PM
Member
User
 
Join Date: Feb 2005
Posts: 66
Rep Power: 0
chiku
Default delete directory linux

hai

how do i delete directory in linux?
Following command is not worlking for me..

Code:
rm directoryname
thank
__________________
There's no place like 127.0.0.1
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-21-2006, 11:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 151
Rep Power: 4
sweta will become famous soon enough
Default

Use rmdir command.

rmdir {dirname} - delete a directory
rm {filename } delete files or directories

Remove empty xyz directory:
Code:
rmdir xyz
Remove empty data.txt file:
Code:
rm data.txt
Remove directory and sub dirs with rm:
Code:
rm -rf photos
__________________
Friends - v-nessa - missyAdmin
Reply With Quote
  #3 (permalink)  
Old 07-22-2006, 02:01 AM
Junior Member
User
 
Join Date: Jun 2006
Location: New Zealand
Posts: 21
Rep Power: 0
Beresford
Default

Also try "rm --help" it will give you some basic help or "man rm" for more detailed help.
The --help and "man" command will work with most other commands.
Reply With Quote
  #4 (permalink)  
Old 07-22-2006, 06:47 PM
Member
User
 
Join Date: Feb 2005
Posts: 66
Rep Power: 0
chiku
Default

Beresford/sweta,

thanks. my problem solved.

Thanks

Sorry for asking such stupid question but some time I just forget command. man command is good one but it needs command name.

Is there any way I can find out command name by giving task. Like I will type query “command to remove a directory” and Linux will tell me use rmdir…?
__________________
There's no place like 127.0.0.1
Reply With Quote
  #5 (permalink)  
Old 07-22-2006, 06:56 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Sure Linux does provides search the manual page names and descriptions facility via apropos command.

Code:
apropos ‘delete a directory’
You can search using section. Most user commands located under man section 1:
Code:
apropos -s 1 remove
colrm (1) - remove columns from a file
cut (1) - remove sections from each line of files
kpackage (1) - Installs, removes, and queries packages.
lprm (1) - remove jobs from the line printer spooling queue
mrd (1) - remove an MSDOS subdirectory
pamdeinterlace (1) - remove ever other row from a PAM/PNM image
rm (1) - remove files or directories
rmdir (1) - remove empty directories
unlink (1) - call the unlink function to remove the specified file

Code:
apropos -s 1 remove| egrep "directory|directories"
You can also use man -k
Code:
man -k ‘delete directory’
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Shell Delete Directory chimu Slackware 2 05-31-2008 03:36 PM
Linux Recursively Delete Subdirectories raj Linux software 0 04-22-2008 01:50 AM
Delete all tables mysql under Linux jerry Databases servers 1 06-09-2007 05:50 PM
Linux delete empty directories raj Getting started tutorials 0 05-05-2007 01:29 AM
Linux find and delete files cbzee Linux software 4 12-20-2006 12:01 PM


All times are GMT +5.5. The time now is 05:50 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36