1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Linux+ Question #7

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

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    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,915
    60
    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
    179
    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 Administrator Administrator

    6,771
    102
    221
    Right then I'll take a stab here then

    3
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Looking at doing ..................
  5. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,915
    60
    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,726
    175
    221
    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
    179
    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...