Skip to main content
LPIC-1 Exam 101

103.3 cp and mv

By July 3, 2014September 12th, 2022No Comments

Topic 103.3 from the LPI LPIC-1 101 exam looks at basic file management and, of course, we can expect some simple demonstrations here; but we all have to start somewhere on our journey. In this tutorial we loo at the command cp and mv. These are both very fundamental commands to Linux and are located in the /bin directory.

When we copy a file we need to be able to read the source file and write to the destination directory

cp /etc/ntp.conf /home/andrew

So in this case we need to be able to read the ntp.conf and write to the andrew directory.

To rename a file we use the command mv. If we do not change the directory we are essentially renaming the file but moving to another directory will move the file to that directory. Here we rename the file with mv:

mv ntp.conf ntp.txt

Now we move it:

mv ntp.txt  ../dir2/

Take a look at the video and practice on your systems.