Cut and Copy in Ubuntu Command line

How Could i copy or cut a file from a directory to another directory?

I mean in command line!


Solution 1:

Simple: type in terminal

For copy

cp /PATH1/file [file2 file3 ...] /PATH2/[newfilename or noting to use the same name]

and for more info about cp use man cp


For cut(move and rename)

mv /PATH1/file /PATH2/[newfilename or noting to use the same name]

and for more info about mv use man mv

Solution 2:

Hi here we go with a practical example:

1. Copy 

    raja@badfox:~/Folder$ mkdir copy
    raja@badfox:~/Folder$ mkdir move
    raja@badfox:~/Folder$ touch file1 file2 file3 file4
    raja@badfox:~/Folder$ cp file1 copy
    raja@badfox:~/Folder$ ls copy
    file1

2. Move


    raja@badfox:~/Folder$ ls
    copy  file1  file2  file3  file4  move
    raja@badfox:~/Folder$ mv file2 move
    raja@badfox:~/Folder$ ls move
    file2
    raja@badfox:~/Folder$ ls
    copy  file1  file3  file4  move


3. Rename

    raja@badfox:~/Folder$ mv file3 file2
    raja@badfox:~/Folder$ ls
    copy  file1  file2  file4  move
    raja@badfox:~/Folder$