Find the answer to your Linux question:
Results 1 to 5 of 5
Hi everybody Here is what i am trying to do yasarcay(at)skynet:~$ cd work yasarcay(at)skynet:~/work$ ls Move and Copy Files in Linux at the Command Line.odt dir2 dir32 kubuntu linux commnads.odt ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    7

    Moving, copying with spaced file names why not working


    Hi everybody

    Here is what i am trying to do

    yasarcay(at)skynet:~$ cd work
    yasarcay(at)skynet:~/work$ ls
    Move and Copy Files in Linux at the Command Line.odt dir2 dir32 kubuntu linux commnads.odt
    yasarcay(at)skynet:~/work$ mv linux commnads.odt linux commands.odt
    mv: target `commands.odt' is not a directory
    yasarcay(at)skynet:~/work$ mv linux commnads.odt dir2
    mv: cannot stat `linux': No such file or directory
    mv: cannot stat `commnads.odt': No such file or directory
    yasarcay(at)skynet:~/work$ cp linux commnads.odt dir2
    cp: cannot stat `linux': No such file or directory
    cp: cannot stat `commnads.odt': No such file or directory
    yasarcay(at)skynet:~/work$

    Where am i doing a mistake. Please help...

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Hi and Welcome !

    Spaces in filename is creating problem and you should use underscore ( _ ) instead of space.
    Use Escape symbol \ or hit TAB key to auto-complete filename.
    Code:
    yasarcay(at)skynet:~/work$ cp linux\ commnads.odt dir2
    Or
    Code:
    yasarcay(at)skynet:~/work$ cp linux<hit TAB key>
    I would suggest you to visit linuxcommand.org
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Feb 2013
    Posts
    7
    Thank you very much. it has worked.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by coldblue View Post
    Thank you very much. it has worked.
    While the above method works, and is correct, you'll be hard pressed to fully escape spaces.

    For that reason, I mention that you can also use double quotes, this will work too, for a file named "Linux Commands.odt" (no quotes):
    Code:
    mv "Linux Commands.odt" ~/Desktop
    Though since we're all using Bash, let's just go with the second part mentioned by devils and tab complete the **** out of any path .

  6. #5
    Just Joined!
    Join Date
    Feb 2013
    Posts
    7
    @ Syndacate

    Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •