how do i delete the directories(having some files) only without delete the files,
rmdir wont remove the directory if it contains some files.
can any help me pls.?
3 2371
how do i delete the directories(having some files) only without delete the files,
rmdir wont remove the directory if it contains some files.
can any help me pls.?
If you remove the directory, then whatever is in the directories goes bye bye as well. The only way to keep the files is to first move them to another directory, if you want to keep them. If you care not about the files, then you could issue something like 'rm -rf <directoryName' and that will force deletion of the directory and everything contained within.
Regards,
Jeff
If you remove the directory, then whatever is in the directories goes bye bye as well. The only way to keep the files is to first move them to another directory, if you want to keep them. If you care not about the files, then you could issue something like 'rm -rf <directoryName' and that will force deletion of the directory and everything contained within.
Regards,
Jeff
Sorry, i have written wrongly.
This is my task
my Top Directory contain some directories(x,y,z) and files(a,b,c)
each directory(x,y,z) contain some files say a1,b1,c1 etc.
i need to delete all the directories(x,y,z) without deleting the files(a,b,c)
any help?
Sorry, i have written wrongly.
This is my task
my Top Directory contain some directories(x,y,z) and files(a,b,c)
each directory(x,y,z) contain some files say a1,b1,c1 etc.
i need to delete all the directories(x,y,z) without deleting the files(a,b,c)
any help?
use this command:
rm -R <directory name>
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jobs |
last post by:
Hello All,
I want to delete all files in a directory. I am making a backup copy of all
files in the directories say c:\abc by reading and writing to a file. After
making a backup copy I want to...
|
by: Xah Lee |
last post by:
here's a large exercise that uses what we built before.
suppose you have tens of thousands of files in various directories.
Some of these files are identical, but you don't know which ones are...
|
by: James |
last post by:
I am looking for a way to delete indirect children records when a root
record is removed. The same action that occurs if you delete a
directory that contains sub directories of sub directories.
...
|
by: David |
last post by:
hello to everybody...
in of directories on my pc i have a list of su-directories, and in each
directory theres an image "picture.ico"...
so then my program is starting to run, i add a new...
|
by: Charts |
last post by:
I login as administrator of the machine. However running the following code
get access denied exception for file inside the directory.
The source code:
DirectoryInfo target = new...
|
by: Paul |
last post by:
I'm trying to make get my app to delete all the files in a specified folder
and all the files within the folders of the specified folder.
e.g.
Folder 1 contains three files (File1, File2, File3)...
|
by: Dan |
last post by:
Hi - I'm about a week into learning VB.NET, and I'm finding I can't delete
any of the VB.NET directory structures that contain my test projects I've
been trying to create. I've never seen this...
|
by: nospam |
last post by:
I am writing this app in .net 2003 since all machines don't have 2.0
framework. I am trying to delete old profiles, but I am getting access
denied or file in use errors. A lot of these files I am...
|
by: Anil Gupte |
last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnu2Exit.Click
Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName)
...
|
by: wolfsbane |
last post by:
Alright, here it is I am trying to write a win32 app in VB 2005 to clean up user's profiles. everything works correctly except for the Delete("directory", True) statement. I get a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |