rm

can't delete directory under linux due to broken files

kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al ls: cannot access post-commit: No such file or directory ls: cannot access update: No such file or directory ls: cannot access post-update: No such file or directory ls: cannot access commit-msg: No such file or directory ls: cannot access pre-rebase: No such file...

Is there any trivial way to 'delete by date' using ´rm'- in bash?

I noticed today (after ~8 years of happily hacking away at bash) that there is no trivial way to 'delete by date' using ´rm'. The solution is therefore to pipe stuff around a combination of commands like rm, ls, find, awk and sed. Say for example I wanted to delete every file in the working directory from 2009, what would be a typical s...

Unable to recover a file in Git

I have two branches in my Git, master and newFeature. At the branch newFeature, I removed the fileA physically first in terminal and then in Git by git rm fileA Subsequently, I run git add . git commit Right now, I need the fileA again. I had the idea that I can get it back, by simply switching to the branch master. I was apparent...

Unable to use yes -command to all questions when removing

I get a long list of read-only protected files when I run rm -r trunk | yes I am trying to answer yes to all by one command. How can you answer yes to all questions? ...

Unable to remove a special named files in terminal

Some program makes ta my root directory dummy files such as -1 -2 -3 ... -n I run unsuccessfully rm -1 and too rm "-1" Terminal thinks that -1 is the option. How can you remove the files in terminal? ...

Unable to find files which have been in the folder one minute in Mac's Zsh

I need to find files which have been in the folder Wastebasket exactly one minute. The files have been moved all over my computer to the folder. I run the following unsuccessfully find -atime n1m . I get all my files in the directory by the command, even ones which I just created. It seems that the option -atime is not correct. How ...

Unable to undo removal in Zsh

I run at path/test rm -r * The tutorial says that I can undo the change by If one of these fancyeditor commands changes your command line in a way you did not intend, you can undo changes withˆ_,ifyou can get it out of your keyboard, orˆXˆU,otherwise. However, I did not get the files back by pressing Ctrl-x Ctrl-u or Ct...

Cron Job on Ubuntu Hardy Executing But Not Deleting Files As Expected

I have a bit of a pickle here and wonder if anyone can give me some pointers: I have a cron job which executes for a particular user daily and is supposed to sweep files in a particular directory. Technically, it is two jobs. I've turned on cron.log to verify they're actually executing, and they are: May 24 11:03:01 AppNameGoesHere /...

Unable to remove files recursively from Git

I want to remove all files from Git at ~/bin/. I run git rm -r --cached ~/.vim/* # Thanks to Pate in finding --cached! I get fatal: pathspec '.vim/colors' did not match any files This error messsage suggests me to use the following PATHs, since ~/.vim/** does not work ~/.vim/* # I get the error ~/.vim/...

how to remove large amount of files using rm

Hi , I tried to remove around 7,000 log files under a directory by using rm *.log but failed with error message "too long argument list" . Is there any way to slove it ? thanks . ...

git: how to add/commit removals made via vanilla rm?

I deleted a bunch of files / directories from a git repository using rm, the Finder, etc. I'm looking for a git command that'll record these to the index as marked for removal. (As if I had called git rm on them.) I understand git add -u will do this, along with a bunch of other things. I'd like my command to exclusively handle removal...

Remove files created between certain time stamps.

Last night I had a script go a bit crazy and create a bunch of directories between 3:00 and 3:09am. Is there a quick one liner that will hunt these down and remove them for me? ...

How to remove files and directories quickly

I am using a mac. When I use the "rm" command it can only remove files. The "rmdir" command only removes empty folders. If you have a directory with files and folders with files and folders in them and so on. Is there anyway to delete all the files and folders without all the strenuous command typing? Remember, I am using the mac bash sh...

ksh : Need to delete multiple directories quickly and reliably

Hi , I have many directories and need to delete them periodically with minimum time. Additionally for each directories delete status need to know i.e whether deleted successfully or not. I need to write on the ksh . Could you please help me out. The sample code which I am using, in which I tried launching rm-rf in the background, is no...

How to convert .rm to .avi with ffmpeg in windows?

Anyone here knows the command? ...

modify shell script to delete folders as well as files

My shell script: #!/bin/bash if [ $# -lt 2 ] then echo "$0 : Not enough argument supplied. 2 Arguments needed." echo "Argument 1: -d for debug (lists files it will remove) or -e for execution." echo "Followed by some path to remove files from. (path of where to look) " exit 1 fi if test $1 == '-d' then find $2 -mmi...