Find the answer to your Linux question:
Page 5 of 8 FirstFirst 1 2 3 4 5 6 7 8 LastLast
Results 41 to 50 of 72
Like Tree10Likes
Originally Posted by DonQuixoteMC I read somewhere that if the (I don't know the technical term) start of the command line(shell prompt?) end looks like this(this is just an example) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #41
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353

    Quote Originally Posted by DonQuixoteMC View Post
    I read somewhere that if the (I don't know the technical term) start of the command line(shell prompt?) end looks like this(this is just an example) me@Linuxbox:~$ then you are not entering commands as root, but if it looks like me@Linuxbox~# you are. Is that true? I'd like to get used to commands and set up multiple logins anyway, but I was just curious.
    it is usually true, but it is more of a convention than a rule. to be sure, run this:

    Code:
    whoami
    if root, this will return UID 0:
    Code:
    id -ru
    also, in a Bash prompt, you can put your username in the prompt, to make to see, e.g.:

    Code:
    export PS1='[\u@\h \w]\$ '
    that could go in ~/.bashrc, and if you are root, it will say so, e.g. your prompt might look like:

    Code:
    [root@localhost ~]#
    zenwalker likes this.

  2. #42
    Just Joined! DonQuixoteMC's Avatar
    Join Date
    May 2013
    Location
    In a tree
    Posts
    39
    Ahhh. OKay, so it's like how Ctrl+C is a common shortcut for copy, but that doesn't mean it always is the shortcut? I'll check that, thanks for the commands.

  3. #43
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Quote Originally Posted by DonQuixoteMC View Post
    me@Linuxbox:~$
    You as you... you can have fun

    Quote Originally Posted by DonQuixoteMC View Post
    me@Linuxbox~#
    You as root (be careful... very very careful!)

    rm -rf is a power command... caution is the word when you are root. But I lost a media directory once when I used that command as a normal user.... so again: caution!!!
    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.

  4. #44
    Just Joined! DonQuixoteMC's Avatar
    Join Date
    May 2013
    Location
    In a tree
    Posts
    39
    Quote Originally Posted by jayd512 View Post
    rm -rf is a power command... caution is the word when you are root.
    When I was reading up on some notable commands, I saw what looked like the ability to change the directory/location to be cleared by the rm -rf command, was that me just making things up? Or can you choose which drive/directory to wipe?

    I lost a media directory once when I used that command as a normal user.... so again: caution!!!
    Ahh. I didn't know that it could still be a "danger" as a normal user.

    I think that says something about Linux, that if you're the root (superuser) you actually have the unrestricted power to do things (With great power comes great responsibility). It always bugged me in windows that the Administrator account was essentially a normal account with a few more options, but the same amount of dialogue boxes to deal with. Oh well, I guess protecting the average user from himself was a smart, general purpose policy for Microsoft to take.

    Thanks for the further clarification. The next chance I get I'll set up some of the safeguards Atreyu suggested.

    And now for me to stop procrastinating and finish up some work.

    Best,
    DonQuixoteMC

  5. #45
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    I love Linux...... You can screw it up with a wrong command. But you actually have to hit the <ENTER> button to do so.
    I screwed up my /home directory a few times, but as a standard user, you don't have the power to mess with the actual system files.
    I've said it before... an experienced Windows user has a better chance of borking the system than a new Linux user.
    Ya gotta love it!
    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.

  6. #46
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by DonQuixoteMC View Post
    When I was reading up on some notable commands, I saw what looked like the ability to change the directory/location to be cleared by the rm -rf command, was that me just making things up? Or can you choose which drive/directory to wipe?
    Like many GNU commands, the "rm" command takes the file (or directory) to remove from command line arguments (in fact, it requires you to provide at least one file/dir name). That means that you specify them after the name of the command itself. from the man page:

    SYNOPSIS
    rm [OPTION]... FILE...

    DESCRIPTION
    This manual page documents the GNU version of rm. rm removes each specified file.

    so, to remove a file in /tmp named "foo.txt", you'd do:
    Code:
    rm /tmp/foo.txt
    if you had multiple files, specify them one after the other, space-delimited. same with dirs, but just include the "-r" to turn on recursion.

    you can also use wildcards to match on multiple files/dirs at once, but i hesitate to even mention them, especially in conjunction with "rm".

    also, don't think of it as wiping a disk; you are just removing that file. well, not really, you're just hiding it from the OS. it is not really deleted unless you use the shred tool (or something similar that implicitly overwrites the data) or toss a thermal grenade in your PC and shut the lid.

  7. #47
    Just Joined! DonQuixoteMC's Avatar
    Join Date
    May 2013
    Location
    In a tree
    Posts
    39
    So would...

    rm /tmp

    clear the (what I'm guessing is the temporary folder- I mean directory) /tmp directory? Or as you put it, not clear but hide from the OS so that it can be overwritten?

    I'm glad you reminded me of that, I always forget that I'm dealing with actual physical components, and not magic haha

    Also, what do you mean by space- delimited? Would that be:

    rm /tmp/foo.txt -foo2.txt -foo3.txt

    and so on? Or would it not have the dashes? Or am I not even close?

    And, wildcarding an "rm" command sounds almost as destructive as that thermal grenade

    DonQuixoteMC

  8. #48
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by DonQuixoteMC View Post
    So would...

    rm /tmp

    clear the (what I'm guessing is the temporary folder- I mean directory) /tmp directory? Or as you put it, not clear but hide from the OS so that it can be overwritten?
    well, it would fail b/c it is a directory, but if you included "-r", then yes, it would delete it (as in hide it). but don't delete /tmp, lots of things use it!

    Also, what do you mean by space- delimited? Would that be:

    rm /tmp/foo.txt -foo2.txt -foo3.txt

    and so on? Or would it not have the dashes? Or am I not even close?
    no dashes, just "rm foo1.txt foo2.txt foo3.txt". the dashes are usually reserved for passing switches (or "options" or "flags") to the programs; like the "-" in "-r" for "rm".

    And, wildcarding an "rm" command sounds almost as destructive as that thermal grenade
    i think you are beginning to get it!

  9. #49
    Just Joined! DonQuixoteMC's Avatar
    Join Date
    May 2013
    Location
    In a tree
    Posts
    39
    Okay, so

    "rm /tmp" fails because it only designated a path to the object that was to be deleted, but no actual object, while "rm /tmp -r" would delete the directory?
    There is a shell tutorial I've been reading, I haven't gotten very far, but don't feel obligated to explain this, I'll figure it out eventually haha

    And no dashes for listing files (like that). Cool, I'll remember that difference

    i think you are beginning to get it!
    I learn from the best!

  10. #50
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,565
    This is probably one of the all time great ideas in software!
    zenwalker likes this.
    What do we want?
    Time machines!

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


    The Fifth Continent

Page 5 of 8 FirstFirst 1 2 3 4 5 6 7 8 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
  •