gun@lemmy.ml to Linux@lemmy.mlEnglish · 1 month agoTried to rm -r my .cache but accidentally did .config instead...message-squaremessage-square60fedilinkarrow-up173arrow-down12file-text
arrow-up171arrow-down1message-squareTried to rm -r my .cache but accidentally did .config instead...gun@lemmy.ml to Linux@lemmy.mlEnglish · 1 month agomessage-square60fedilinkfile-text
minus-squareZozano@lemy.lollinkfedilinkEnglisharrow-up9·edit-21 month agoThat’s why I always: cd .cache ls rm -r *
minus-squarePeer@discuss.tchncs.delinkfedilinkarrow-up14·1 month agoType a space before rm to prevent it from being added to your history to be a extra careful.
minus-squarewh0_cares@lemmy.blahaj.zonelinkfedilinkarrow-up14·1 month agoHoly shit, I never knew you could do that! I’ve always really wanted a feature to stop random commands from being added to my history.
minus-squareEdo78@feddit.itlinkfedilinkarrow-up1·1 month agoSome shells provide ways to prevent some commands to be added to the history
minus-squareSayCyberOnceMore@feddit.uklinkfedilinkEnglisharrow-up2·1 month agoFor which shell? I just tried that on a bash system and the command was still stored in .bash_history 😔
minus-squarePeer@discuss.tchncs.delinkfedilinkarrow-up3·1 month agoSet the HISTCONTROLvariable. If it is set to ignorespace then commands entered with a leading-space will not be stored in the history.
minus-squareExtremeDullard@lemmy.sdf.orglinkfedilinkarrow-up1·1 month ago rm -r * Also, if you have to type that, don’t use the numpad: / is only one key away from *. If you finger snags the / key on its way to * and you happen to be root, your root partition will go bye-bye.
That’s why I always:
Type a space before rm to prevent it from being added to your history to be a extra careful.
Holy shit, I never knew you could do that! I’ve always really wanted a feature to stop random commands from being added to my history.
Some shells provide ways to prevent some commands to be added to the history
For which shell? I just tried that on a bash system and the command was still stored in .bash_history 😔
Set the
HISTCONTROL
variable. If it is set toignorespace
then commands entered with a leading-space will not be stored in the history.Also, if you have to type that, don’t use the numpad: / is only one key away from *. If you finger snags the / key on its way to * and you happen to be root, your root partition will go bye-bye.