[SOLVED] my Copy command acting weird

so i decided to learn Kali and i and install the new update of it Kali Linux 2020.1
so i encountered this problem
linuxleearn

1 Like

You’re changing to root user and that user does not have a Documents folder which is also why you can’t auto complete it in the command line:

su
cd
mkdir Documents
cp /tmp/lone Documents/
3 Likes

ahhh so i should just using the normal user and use sudo right

su -
cd
mkdir Documents
cp /tmp/lone Documents/

And

sudo mkdir /root/Documents
sudo cp /tmp/lone /root/Documents/

Are pretty much the same thing, the exception is that the first you’re executing as root so you already have the privileges to run those commands, the later you’re running as a user so you need sudo for those commands to perform with higher privileges, since a user doesn’t have access to /root by default.

The main reason root doesn’t have that folder, is most likely because you never logged that user into the visual interface of your *nix, that is not even recommended, which is why you’re always tied to a regular user and the use of sudo is required to have elevated privileges.

Without knowing more specifically what you’re trying to achieve it would be hard to help you there.

2 Likes