Score:0

How to delete a script var/tmp

in flag

I get the following error while trying to delete a temp file. I can't change the permissions because apparently I'm not the owner.Any assistance on how to go about it will greatly be appreciated

There was an error deleting the file "battery-status-1.sh.swl" Error removing file /var/tmp/battery-status-1.sh.swl: Operation not permitted

cocomac avatar
cn flag
(1) Why are you trying to delete this file? (2) What is the exact command you ran to try to delete it?
Jumba Mark avatar
in flag
I was creating a scriptin the tmp folder and it didn't go as expected. I've tried opening the tmp folder in terminal and then ran; rm -rf *
cocomac avatar
cn flag
No don't do that. If you want to delete that file, `sudo rm someFile` should work fine. One thing to know... some systems will sometimes clean up the tmp folders. So I suggest not storing your files there. Your home directory, or better yet Git, is a better option.
us flag
@cocomac `/var/tmp` is supposed to be preserved between reboots according to [FHS](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard).
cocomac avatar
cn flag
@doneal24 Yes. But [this Unix SE post](https://unix.stackexchange.com/a/30504/495409) notes that "Some systems also clean `/var/tmp`, but less often."
Jumba Mark avatar
in flag
@cocomac, Thanks bro. It worked. I cant thank you enough
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.