▲ 484 ▼ Who hasn't typed a risky command? Throw the first stone! (programming.dev) submitted 7 months ago by calango@programming.dev to c/programmer_humor@programming.dev 35 comments fedilink hide all child comments Sudo rm -rf .
[–] lena@gregtech.eu 35 points 7 months ago (5 children) Maybe he wanted to remove only files with a dot in the name permalink fedilink source parent hideshow 5 child comments replies: [–] jaybone@lemmy.zip 10 points 7 months ago (4 children) And if he’s on / (root) on most common distros, there won’t be any dirs with . (dot) in their name. Unless this matches the dot from the cwd, in which case this is the same as “rm -rf /“? Now I’m curious, I don’t often perform operations on the cwd using dot. permalink fedilink source parent hideshow 4 child comments replies: [–] lena@gregtech.eu 6 points 7 months ago (3 children) At least bash doesn't seem to match it... gregor@raspberrypi:~ $ ls bridge navidrome seed traefik gregor@raspberrypi:~ $ ls *.* ls: cannot access '*.*': No such file or directory gregor@raspberrypi:~ $ cat *.* cat: '*.*': No such file or directory permalink fedilink source parent hideshow 3 child comments replies: [–] jaybone@lemmy.zip 2 points 7 months ago* (2 children) Right, so then if asterisk wildcards don’t match on . and .. then, in most common distros where there is no dot in any of the top level dirs in /, “rm -rf *.*” in the top level / dir is basically harmless and likely a noop. So OP is wrong. permalink fedilink source parent hideshow 2 child comments replies: [–] lena@gregtech.eu 1 point 7 months ago* (1 child) Technically, it says he's in the ~ directory, which would usually be /home/god, but even in there there aren't usually any directories/files with a dot. permalink fedilink source parent hideshow 1 child comment replies: [–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent
[–] jaybone@lemmy.zip 10 points 7 months ago (4 children) And if he’s on / (root) on most common distros, there won’t be any dirs with . (dot) in their name. Unless this matches the dot from the cwd, in which case this is the same as “rm -rf /“? Now I’m curious, I don’t often perform operations on the cwd using dot. permalink fedilink source parent hideshow 4 child comments replies: [–] lena@gregtech.eu 6 points 7 months ago (3 children) At least bash doesn't seem to match it... gregor@raspberrypi:~ $ ls bridge navidrome seed traefik gregor@raspberrypi:~ $ ls *.* ls: cannot access '*.*': No such file or directory gregor@raspberrypi:~ $ cat *.* cat: '*.*': No such file or directory permalink fedilink source parent hideshow 3 child comments replies: [–] jaybone@lemmy.zip 2 points 7 months ago* (2 children) Right, so then if asterisk wildcards don’t match on . and .. then, in most common distros where there is no dot in any of the top level dirs in /, “rm -rf *.*” in the top level / dir is basically harmless and likely a noop. So OP is wrong. permalink fedilink source parent hideshow 2 child comments replies: [–] lena@gregtech.eu 1 point 7 months ago* (1 child) Technically, it says he's in the ~ directory, which would usually be /home/god, but even in there there aren't usually any directories/files with a dot. permalink fedilink source parent hideshow 1 child comment replies: [–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent
[–] lena@gregtech.eu 6 points 7 months ago (3 children) At least bash doesn't seem to match it... gregor@raspberrypi:~ $ ls bridge navidrome seed traefik gregor@raspberrypi:~ $ ls *.* ls: cannot access '*.*': No such file or directory gregor@raspberrypi:~ $ cat *.* cat: '*.*': No such file or directory permalink fedilink source parent hideshow 3 child comments replies: [–] jaybone@lemmy.zip 2 points 7 months ago* (2 children) Right, so then if asterisk wildcards don’t match on . and .. then, in most common distros where there is no dot in any of the top level dirs in /, “rm -rf *.*” in the top level / dir is basically harmless and likely a noop. So OP is wrong. permalink fedilink source parent hideshow 2 child comments replies: [–] lena@gregtech.eu 1 point 7 months ago* (1 child) Technically, it says he's in the ~ directory, which would usually be /home/god, but even in there there aren't usually any directories/files with a dot. permalink fedilink source parent hideshow 1 child comment replies: [–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent
[–] jaybone@lemmy.zip 2 points 7 months ago* (2 children) Right, so then if asterisk wildcards don’t match on . and .. then, in most common distros where there is no dot in any of the top level dirs in /, “rm -rf *.*” in the top level / dir is basically harmless and likely a noop. So OP is wrong. permalink fedilink source parent hideshow 2 child comments replies: [–] lena@gregtech.eu 1 point 7 months ago* (1 child) Technically, it says he's in the ~ directory, which would usually be /home/god, but even in there there aren't usually any directories/files with a dot. permalink fedilink source parent hideshow 1 child comment replies: [–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent
[–] lena@gregtech.eu 1 point 7 months ago* (1 child) Technically, it says he's in the ~ directory, which would usually be /home/god, but even in there there aren't usually any directories/files with a dot. permalink fedilink source parent hideshow 1 child comment replies: [–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent
[–] psud@aussie.zone 1 point 7 months ago ~ has many dot directories and files permalink fedilink source parent