I want copy and paste a file. The name of the file is mkoctfile.m
.
The path of this file is:
/usr/share/octave/3.2.4/m/miscellaneous/mkoctfile.m
I want to paste it to the following path
/usr/bin/mkoctfile-3.2.4
I have made the directory by using following commands:
sudo su
mkdir -p /usr/bin/mkoctfile-3.2.4
but I don't know how to copy and paste mkoctfile.m
in this path.
Please tell me what command I have to use.
Use the
cp
command to copy a file, the syntax goescp sourcefile destinationfile
. Use themv
command to move the file, basically cut and paste it somewhere else.The exact syntax you would use for your example is:
For more information on the
cp
ormv
commands you can run:or
To view the manual pages
You can cut, copy, and paste in CLI intuitively like the way you usually did in the GUI, like so:
cd
to the folder containing files you want to copy or cut.copy file1 file2 folder1 folder2
orcut file1 folder1
cd
to the folder where you want to paste them.paste
To be able to do so, make sure you have installed
xclip
andrealpath
. Then, append these functions to the end of your ~/.bashrc file:If you don't know what .bashrc file is and never modify it before, just open the file explorer, go to Home, press Ctrl+H (show hidden files), search for .bashrc and open it with a text editor like gedit.
Note
By using the above script, you are overriding the default functionality of these commands:
copy
is a reserved PostgreSQL command.cut
andpaste
are reserved Linux command.If you use one of those commands default functionality, just modify the script function names accordingly. For example, use
p
instead ofpaste
.Go to that directory from where you want to copy file i.e /usr/bin/octave/3.2.4/m/miscellaneous
Then type
../../../
means you are going backward to bin folder and type whatever directory in which you want to copy your file.