Questions tagged [rm]

rm is a basic UNIX command used to remove files, directories, and other items from the filesystem.

rm is a basic UNIX command used to remove files, directories, and other items from the filesystem.

Options:

-f force
-r, -R or --recursive

Examples

rm -rf /some/dir #removes all files and dirs recursively from this point

References

534 questions
-2
votes
1 answer

how to commit the files that i delete using rm rather than git rm?

git add seems not works for these deleted files, so how to commit the changes? $ git status # On branch master # Changes not staged for commit: # (use "git add/rm ..." to update what will be committed) # (use "git checkout -- ..." to…
hugemeow
  • 7,777
  • 13
  • 50
  • 63
-3
votes
4 answers

How to delete a folder with other files and folders inside with PHP

Possible Duplicate: A recursive remove directory function for PHP? With PHP I want to know the easiest way for delete a folder with files and folders inside.
Yasmina Saraya
  • 95
  • 1
  • 1
  • 4
-3
votes
1 answer

What does rm ** does in LINUX

what does rm ** do in linux. started learning linux and stuck here. I tried reading but couldnt understand or didn get the answer
jenito
  • 3
  • 3
-3
votes
2 answers

Difference between rm -rf *o and rm -rf *.o

I'm wondering if the two commands (1) rm -rf *o and (2) rm -rf *.o give the same result: both delete the object files. Moreover why the above commands delete the executable files as well?
Gennaro Arguzzi
  • 769
  • 1
  • 14
  • 27
-3
votes
1 answer

Catching rm -rf (mac/linux) in script - protecting via password - not letting delete files

I am looking at building a script, which eventually needs to install some application - copying folders/files to certain places in Mac & Linux. User should not be able to delete those folders/files or the script i pass to user. Is there any way to…
Shekar
  • 21
  • 4
-3
votes
1 answer

How parsing works for unix commands: "rm" and "cp"

We are executing below commands rm -f $folder_name/filename* cp $folder_name1/filename1* $folder_name/ After checking the execution log we get following command executions rm -f '/home/user/file*' cp /home1/user1/file1* /home/user/ Why rm…
Kamlesh Khollam
  • 111
  • 2
  • 15
-3
votes
1 answer

how to run a bash script in background automatically?

I need to write a bash script that automatically deletes temp files, and runs in the background each day. #!/bin/bash while true; do rm /home/c/temp/* sleep 24h done but it doesn't work
user3144841
  • 11
  • 1
  • 4
-4
votes
1 answer

what happened if i rm a file without unstaging it?

lately, I've been learning git, then I came to the git rm that kind of confused me, I kept digging in and understood most of it, but there is a question still baffling me, what will happen if I deleted a file using the normal bash rm command without…
-4
votes
1 answer

How to revert a git rm -r .?

I added my files to local respository, committed the add then removed the files. I wasn't logged into gitlab at the time. how can I revert it?
1 2 3
35
36