Random Linux+ Question #7

Discussion in 'Linux+' started by tripwire45, Jun 28, 2005.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    On the command line, which of the commands listed below would let you change the name of the file linux-security-guide to linux-security-guide-old in the current directory? Choose only one answer:

    1. cp linux-security-guide linux-security-guide-old

    2. mv linux-security-guide linux-security-guide-old

    3. cn linux-security-guide linux-security-guide-old

    4. chmod linux-security-guide to linux-security-guide-old

    5. You cannot use file names with dashes ( - ) in them so none of the above commands is valid.

    Answer later.
     
    Certifications: A+ and Network+
  2. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,924
    74
    229
    oooh, at last one I could take a stab at ...:)
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    So...take a stab. Or are you waiting for those "hide" tags Tomshawk mentioned that would conceal a member's answer from those who haven't answered yet? :wink:
     
    Certifications: A+ and Network+
  4. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Right then I'll take a stab here then

    3
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  5. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,924
    74
    229
    OK, so I was rash ...:oops:

    As far as I can tell, cp would let you copy the file or directory, but looking at the way you phrase the question, and from my experience of our Linux-based servers, chmod alters the permissions on the file to allow you to then rename it. I use chmod daily at work when customers have buggered up their directory permissions or need certain access for certain filetypes, etc.


    So it has to be cn

    But I know I'm going to crash and burn again as always here, Trip ...
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  6. nugget
    Honorary Member

    nugget Junior toady

    7,796
    71
    224
    Number 1 is my choice of answer.:D
     
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685
  7. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    linux doesnt have a rename command
    you move the file from one location to the other, that includes the name not just the directory

    2
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  8. EMacd

    EMacd Bit Poster

    38
    3
    8
    Yeah, 2 for this one
     
  9. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    Answer time: the correct answer is 2: mv linux-security-guide linux-security-guide-old.

    As correctly pointed out, linux has no rename command. When you use the mv (move) command and move a file within the same directory using a different name, the name of the file changes. If you use this command specifying the name of a file that does exist, the first file (in this case "linux-security-guide") will be moved into the second file ("linux-security-guide-old").
     
    Certifications: A+ and Network+

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.