read.cash is a platform where you could earn money (total earned by users so far: $ 798,345.35).
You could get tips for writing articles and comments, which are paid in Bitcoin Cash (BCH) cryptocurrency,
which can be spent on the Internet or converted to your local money.
So... then I can't copy directories? What do I do then?
Of course we can do that. We just need to tell the cp command to enter the directory and copy all the files and any subdrectories that it contains. This is done by specifying the parameter to tell it to copy recursively, or
cp -r my_directory copied_directory
I can then use the ls command to prove that I have copied it.
A screenshot of the whole example above in my terminal.A screenshot of the whole example above in my terminal.
Similarly, files can be moved from one place to another. Also, a file can be renamed by using the move command to a new name. The command is simply mv. Moving directories does not require the parameter -r. For example,
If you want to remove a file, you need to use the rm command. I previously moved the file called moved_file to my_directory. Now I want to remove this file. I need to type
rm moved_file
and when I list the files, it is gone.
Wait... but this is prone to mistakes! Windows always asks if you want to delete something. And usually, it moves it to the recycle bin. I'm going to lose my precious data by simple mistakes!
There is a solution to that. One needs to add the parameter -i, meaning interactive:
rm -i file1 rm: remove regular file 'file1'?
When I type n and press enter, it will keep my file. And, of course, if I indeed want to delete it, I need to type y.
Moving directories requires the recursive flag:
rm moved_directory/ rm: cannot remove 'moved_directory/': Is a directory
rm -r moved_directory/
And I can also add the -i flag to make it ask me for a confirmation.
A screenshot of the example about removing files and directories in my terminal.A screenshot of the example about removing files and directories in my terminal.
One can redefine commands, so that typing rm includes also the interactive parameter using the alias command, however, I will dedicate a separate article on that. But next time we can start editing files. There is plenty to say about that matter and as you will find out, choosing the editor is a heated topic among Linux users. And everybody thinks that they're right.
Many times I tried to learn and use the terminal to put these commands into practice but in the end I always got carried away by the simplicity of the graphical mode. I will be looking forward to your new publications. Regards.
Many times I tried to learn and use the terminal to put these commands into practice but in the end I always got carried away by the simplicity of the graphical mode. I will be looking forward to your new publications. Regards.