Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-2 votes
1 answer
79 views

How to remove all directories in a folder in command line?

I want to remove all directories in a folder, no mater the specified directory is empty or not. Can I do this in command line?
Koen's user avatar
  • 321
-1 votes
1 answer
582 views

Delete all files & directories in a folder except one file

I want to delete all files & directories in a folder say 'A'. But except one file in that folder say .keep. I have tried the following command. find A ! -name '.keep' -type f -exec rm -f {} + ...
Dushyant Joshi's user avatar
-1 votes
2 answers
2k views

Using rm for a file in a directory

I'm new using the linux commands and I'm having a problem using the rm command in a makefile. The makefile is in the /project directory and I want to remove all the files with extension .o that are ...
ezeg's user avatar
  • 35
1 vote
2 answers
13k views

what's the difference between rm -rf and rm -r? [closed]

In linux, what is the difference between 'rm -rf' and 'rm -r', both seem to do the same things (delete an entire directory). Here is a few commands that I ran to test it: mohammad@mohammad-ThinkPad-...
mdash1's user avatar
  • 1,115
7 votes
1 answer
4k views

Linux rm -rf * delete orders? [closed]

I thought rm removes the files in alphabetically, but clearly it's not after my executation. So, what 's the order of command rm executation?
michael_stackof's user avatar
3 votes
6 answers
188 views

how to delete a file started with '-'

How can I delete a file whose name started with '-'? For example, if I have a file named -a and I delete it with: rm -a I will get: rm: invalid option -- 'a' Try 'rm --help' for more ...
Given92's user avatar
  • 101
0 votes
1 answer
1k views

Command Line to find and delete Similar files in Linux

I want to find and delete all the "similar files as shown below" recursively from the specified directory of my Linux Server by Using COMMAND LINE.... "file.php?p=10&file=load%2Fnew ...
A.A's user avatar
  • 2,713