Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24
Like Tree4Likes
I have sent for a copy of Neal Stephenson's - In the beginning was the command line. Knowing that I am very prone to make mistakes, errors, blunders, etc. with ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast cousinlucky's Avatar
    Join Date
    Dec 2005
    Location
    New York City
    Posts
    676

    A command line Do Not Do List, Please!!


    I have sent for a copy of Neal Stephenson's - In the beginning was the command line. Knowing that I am very prone to make mistakes, errors, blunders, etc. with my computer I figure it is wise to ask now about things I should never do before I get the book and make an idiot of myself.

    Any and All Taboos would be greatly appreciated!! Thanks!!
    PCLinuxOS Gnome and PCLinuxOS Mate
    Linux user # 414321
    You Should Not Give In To Evils, But Proceed Ever More Boldly Against Them!! -from book six of Virgil's Aeneid
    Everything Within The Universe Is Related; We Are All Cousins!!

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,309
    On the command line never run
    Code:
    rm -rf /
    as root. Not if you want any files left on your disk! Also
    Code:
    any_command > /dev/sda
    is very very bad as it will overwrite the disk.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

  3. #3
    Linux Enthusiast cousinlucky's Avatar
    Join Date
    Dec 2005
    Location
    New York City
    Posts
    676
    Ouch and Ouch!!
    PCLinuxOS Gnome and PCLinuxOS Mate
    Linux user # 414321
    You Should Not Give In To Evils, But Proceed Ever More Boldly Against Them!! -from book six of Virgil's Aeneid
    Everything Within The Universe Is Related; We Are All Cousins!!

  4. #4
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    If you decide to delete or change a file, make a copy of it first.
    Code:
    cp filename filename.orig
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  5. #5
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Hello, cuz

    The majority of commands available do have some beneficial use, but some can be dangerous toward a working system when used carelessly, so I'd say the rule of thumb is don't run any command unless you have some idea about what it is going to do. You can find a nice listing of Linux commands for your review at the following site:

    Linux Command Directory - O'Reilly Media
    oz

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by elija View Post
    On the command line never run
    Code:
    rm -rf /
    as root. Not if you want any files left on your disk! Also
    Code:
    any_command > /dev/sda
    is very very bad as it will overwrite the disk.
    One good tip is to set up aliases for the cp/rm/mv commands, so that the '-i' flag is always passed. This will prompt you before deleting/overwriting files. e.g., in my bashrc, I have:

    Code:
    alias mv='mv -i'
    alias rm='rm -i'
    alias cp='cp -i'
    Most distros make this the default now, but I still encounter it every now and then. Of course, this will only work if you don't use the -f/force flag when calling the command:

    Code:
    rm -r *
    the "rm -rf" version will still screw you.

    same thing if you call the binary absolutely (e.g., "/bin/rm *"), that'll override the alias, too.

    Along those lines, don't run fdisk (sfdisk, cfdisk, parted, etc.) unless you know what you are doing, are following trusted instructions, and are prepared for the worst.

    In fact, don't even use the root account, use sudo (until you really trust yourself). You can still kill your box w/sudo, but at least you have to think about it a little before running half-baked commands.

  7. #7
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,167
    1) Never do anything as root that you can do as yourself.

    2) Never log on as root. You'll forget and break rule 1). Use su or sudo.

    3) Always read the man page first.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  8. #8
    Linux Enthusiast cousinlucky's Avatar
    Join Date
    Dec 2005
    Location
    New York City
    Posts
    676
    I have not gotten the book yet and I'm already terrified!!
    PCLinuxOS Gnome and PCLinuxOS Mate
    Linux user # 414321
    You Should Not Give In To Evils, But Proceed Ever More Boldly Against Them!! -from book six of Virgil's Aeneid
    Everything Within The Universe Is Related; We Are All Cousins!!

  9. #9
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,309
    LOL. Don't run anything as root and you should be fine.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

  10. #10
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by elija View Post
    LOL. Don't run anything as root and you should be fine.
    ...or have a good system backup image on hand (and stored elsewhere) so that you can experiment all you want as root with any and all commands. That said, it's a very good idea to have some type of backup on hand no matter how advanced or inexperienced a computer user might be.
    elija likes this.
    oz

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •