Mobile Finance Marketplace Borderless Payments, Lending, and Credit!

in #rusteemteam5 years ago (edited)

Today, we continue to study how to use the linux console.

File copying
We will use the cp command to copy files.
If we want to copy the file, we need to type in the cp console and then specify the source and destination file after a spacebar.
Example (we are still in the kostroma folder that we created yesterday):
cp antonkostroma.txt gondonkostroma.txt
Thus we copied the file antonkostroma.txt into the file gondonkostroma.txt, that is we have a file with exactly the same content but with a different name nearby. It also looks better, doesn't it? =)

()

If we want to copy a file to another folder or to another disk, you should specify file paths:
sudo cp gondonkostroma.txt /home/lin
This command will copy the gondonkostroma.txt file from the current folder to the /home/lin folder (this is my home folder). sudo I used to give this operation admin rights with password confirmation, otherwise the Linux will not allow you to write anything into the system/home directory, so it protects itself from malware.
Then go to the destination folder (in this case it's my home /home/lin) and use the ls command to make sure that the file has been copied to the right place.

()

You can copy several files at once.
For example:
sudo cp gondonkostroma.txt antonkostroma.txt /home/lin
This command will copy the files gondonkostroma.txt and antonkostroma.txt from the folder ~/pic/kostroma (current) to the folder /home/lin (home). Then go to the /home/lin folder and make sure that everything is copied properly.

()

If you need to copy files with similar names, you can choose them by name/extension mask.
For example, to copy all files with the extension .txt and beginning with the letter "a" - you should use this construction:
cp a*.txt /home/lin
where the * icon replaces any set of characters, so that all files with the .txt extension starting with a will be copied to the /home/lin folder

()

If we want to copy all the contents of the folder, we specify it as *.* or just *.*

()

[continuation follows...]

Text.ru - 100.00%