Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-1 votes
1 answer
1k views

Unable to delete thousands of files within a folder in terminal

I'm trying to delete files inside a certain folder but it's throwing an error: rm -rf /usr/html/sched/downloads/* -bash: /bin/rm: Argument list too long I searched online and found this solution but ...
Elaine Byene's user avatar
  • 4,142
-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
0 votes
0 answers
232 views

how to call a command from a bash script in Linux

I am trying to call a command from a script (defined as functions inside .bashrc) as following the first function hooks the rm command by deleting any file except a file named "forensicfile1" #...
user2976356's user avatar
3 votes
1 answer
5k views

How to turn on warning on rm command?

I recently installed Ubuntu and find that when I delete things in terminal using rm file there is no warning asking me to confirm the step. I did not use the -f flag. It feels vulnerable to ...
S Wang's user avatar
  • 223
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
30 votes
3 answers
267k views

How to recover the deleted files using "rm -R" command in linux server? [closed]

I have unfortunately deleted some important files and folders using 'rm -R ' command in Linux server. Is there any way to recover?
Srini's user avatar
  • 309
1 vote
2 answers
575 views

Remove first a from $HOME/a/a/b/c

I was reading a book on UNIX when I came across this question. You have a directory structure $HOME/a/a/b/c where the first a is empty. How do you remove it and move the lower directories up? I ...
crisron's user avatar
  • 363
3 votes
6 answers
187 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
0 votes
1 answer
1k views

How to delete all exe in a pendrive in linux

There are a lot of exe files in my pen-drive (reside in different directories). How can I delete all the files using Linux command?
Mohammed H's user avatar
  • 7,018
96 votes
3 answers
139k views

Powershell Command: rm -rf

rm is to remove item, but what is the parameter -rf do or signify? Whenever I typed help -rf it printed the entire list of available commands in powershell. What happens if you type rm -rf in ...
BK_'s user avatar
  • 963