1

How to move content of one directory into another directory? I want to move content from /Downloads/kafka_2.11-1.0.1 into directory /usr/local/bin/kafka

I tried to move it using solutions found on the web but it doesnt work.

$ mv /Downloads/kafka_2.11-1.0.1/* /usr/local/bin/kafka

produces error:

mv: cannot stat ‘/Downloads/kafka_2.11-1.0.1/*’: No such file or directory
mat2
  • 11

2 Answers2

2

Please try

sudo mv ~/Downloads/kafka_2.11-1.0.1/* /usr/local/bin/kafka

assuming you have your Downloads folder in your home directory. Anyway you need to run it with sudo to move it to /usr/local/bin/.

sinecode
  • 205
  • The problem might be that I as a user I want move content from my home directory /Downloads/kafka_2.11-1.0.1 into root directory /usr/local/bin/kafka . – mat2 Mar 24 '18 at 20:43
  • The problem might be that as a user I want move content from my home directory /Downloads/kafka_2.11-1.0.1 into root directory /usr/local/bin/kafka . Im trying to use the command stated on the top, in my user home dir, Im not log in as root user. – mat2 Mar 24 '18 at 20:51
  • So probably you can't move files to /usr/local/bin/, because usually only root users can. – sinecode Mar 24 '18 at 20:59
  • Yes thats what I also thought, so if I log in as root user, what command should use? – mat2 Mar 24 '18 at 21:04
  • sudo mv /home/<your_username>/Downloads/kafka_2.11-1.0.1/* /usr/local/bin/kafka – sinecode Mar 24 '18 at 21:06
  • So I think you can mark that answer as correct :) – sinecode Mar 25 '18 at 09:53
-1

You use it incorrectly. Try mv kafva newdirectory. Or you did specify directory path incorrectly, so it cannot find /Downloads/tra-ta-ta/*

Update: Are you really have Downloads in root directory? Either path is incorrect or you dont have enough permissions, use sudo mv ...

LeonidMew
  • 2,734
  • 1
  • 21
  • 38
  • Yes I have Downloads dir and inside of that another directory kafka_2.11-1.0 . Content of kafka_2.11-1.0 directory I want to move into existing root directory, the path for that dir is /usr/local/bin/kafka – mat2 Mar 24 '18 at 20:45
  • 1
    Where you have "Downloads"? If it in home dir other answers is correct – LeonidMew Mar 24 '18 at 20:48