Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

putting things in folders

Discussion in 'General Discussion' started by Dan Lester, Dec 10, 2017.

  1. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    So in Unix, if y is a folder, and x is a file, "cp x y" will put x inside y. But in cPanel, you need to do "cp x y/". Otherwise you just get a new file named y. I'm not really familiar with Linux. Is this just Linux, or is this bolluxed Unix?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The behavior you see matches how the "cp" command works on your OS (e.g. CentOS). It's not specific to cPanel.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    Nope. My OS interprets "cp x y" as a command to copy the file x into the folder y (if y is a folder). That's Unix standard. I certainly don't have to do "cp x y/" to do that.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Here's the behavior I see on a test system running CentOS 7 with cPanel installed:

    Code:
    # cd /root/testing123
    # ls -al
    total 4
    drwxr-xr-x   3 root root   22 Dec 11 13:11 .
    dr-xr-x---. 16 root root 4096 Dec 11 13:10 ..
    -rw-r--r--   1 root root    0 Dec 11 13:11 x
    drwxr-xr-x   2 root root    6 Dec 11 13:11 y
    # cp x y
    # ls -al y/
    total 0
    drwxr-xr-x 2 root root 14 Dec 11 13:12 .
    drwxr-xr-x 3 root root 22 Dec 11 13:11 ..
    -rw-r--r-- 1 root root  0 Dec 11 13:12 x
    Thus, it's working as expected without the need to use "y/" in the "cp" command. You may want to check with your hosting provider to determine if they are using custom bash settings on the system.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Dan Lester

    Dan Lester Active Member

    Joined:
    Dec 7, 2017
    Messages:
    36
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Austin TX
    cPanel Access Level:
    Website Owner
    OK, thanks. Yes, it must be my hosting provider that is doing something strange. First time I've ever seen it that you can use an identical name for a file and a folder in the same directory. But in my cPanel system, y and y/ are different things.
     
Loading...
Similar Threads - putting things folders
  1. Anoop P Alias
    Replies:
    1
    Views:
    541

Share This Page

  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.
    Dismiss Notice