Ansible: How to delete files and folders inside a directory?

The below code only deletes the first file it gets inside the web dir. I want to remove all the files and folders inside the web directory and retain the web directory. How can I do that? – name: remove web dir contents file: path=”/home/mydata/web/{{ item }}” state=absent with_fileglob: – /home/mydata/web/* Note: I’ve tried rm … Read more

Linux delete file with size 0 [duplicate]

This question already has answers here: How to delete many 0 byte files in linux? (10 answers) Closed 5 years ago. The community reviewed whether to reopen this question 9 months ago and left it closed: Not suitable for this site We don’t allow questions about general computing hardware and software on Stack Overflow. You … Read more

Can I delete data from the iOS DeviceSupport directory?

After going through and cleaning my disk with old things that I didn’t need anymore, I came across the iOS DeviceSupport folder in ~/Library/Developer/Xcode which was taking nearly 20 GB. A similar question has been asked before, but since then many things have changed and I would like an up-to-date answer. As long as I have the … Read more

How to remove a directory from git repository?

I have 2 directories on my GitHub repository. I’d like to delete one of them. How could I do that without deleting and re-creating entire repository? 1 16 Remove directory from git and local You could checkout ‘master’ with both directories; git rm -r one-of-the-directories // This deletes from filesystem git commit . -m “Remove … Read more

Remove a file from a Git repository without deleting it from the local filesystem

My initial commit contained some log files. I’ve added *log to my .gitignore, and now I want to remove the log files from my repository. git rm mylogfile.log will remove a file from the repository, but will also remove it from the local file system. How can I remove this file from the repo without … Read more