화요일, 12 월 09번째, 2008 | 저자:

To fail at failing. I recently came across a discussion where a user was advised to run a fail command. The result was, luckily, as follows:

[user@user-desktop ~]$ cd ~/.Trash; sudo rm -rfv *
세게 때리다: CD: /home/user/.Trash: No such file or directory
bash: 남쪽으로: command not found
[user@user-desktop ~]$

The command CD ~/.Trash Changes the directory (또는 present working directory) to the /home/user/.Trash folder. 이 경우, this folder doesn’t exist and so the pwd stays as /home/user/, the folder where 모든 the user’s files and settings are saved.

The command rm -rfv * Rmoves all files in the pwd. Thevpart indicates that it must show verbose output indicating what is being done during this removal process. The prefixed command 남쪽으로 (ubstitute user do) has the command run as 뿌리. 이렇게, had the 남쪽으로 command been functional, 사용자 would have deleted every document he had ever saved in his home folder.

Word of advice from a backup admin: backup often. 😉

몫
범주: 리눅스
당신은을 통해이 입장에 어떤 응답을 따를 수 있습니다 RSS 2.0 먹이. 당신은 할 수 있습니다 응답을 떠나, 또는 트랙백 자신의 사이트에서.

5 응답

  1. The most appropriate command would have been:
    [user@user-desktop ~]$ cd ~/.Trash && sudo rm -rfv *

    The difference is that the “&&” will only run the second command *if* the first command is successful

  2. ^^ or even just:
    [user@user-desktop ~]$ sudo rm -rfv ~/.Trash/*

  3. 3
    moo 

    You knowOSS geekery is so depressingif you were an MS nerd as nature intended there wld just be a group policy to stop this from happening. You may now commence to rebutt.

  4. 4
    moo 

    That being said, the occasional visit from the rm -rf fairy never did anyone any harmalong the same lines as the principles of following a high-fibre diet, and probably for the same reason

  5. I love fairies. 🙂

    Only rebutt is that it isn’t specifically an OSS problem. 그렇지 않으면, I’m happy having your honest comments here. 😉

    U just got me reading up on RBACprobably the future of *nix security. Time will tell. 😉

회신을 남겨주세요 » 로그인