Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 37595  / 1 Year ago, sun, may 14, 2023, 3:38:04

If I use the cp command to copy a directory A to the inside of directory B, will it double the amount of space that it takes up (directory A + copied version of directory A)? I can't imagine that would be the case, but would it disturb the look up time on disk for the files in that directory?



I am a beginner so I'm sorry if this question doesn't really make sense.


More From » filesystem

 Answers
0

cp copies files. If you specify a directory (I've never tested this) it would probably copy the contents of this directory, and place them all (including the original folder) into the destination directory. Yes, it will create two copies of the target file(s) and yes, it will probably disturb a number of things like that.



You can drag and drop files easily in Nautilus to move them naturally, without the negative effects on hard drive optimization. The mv command in terminal will do the same thing. It's similar in usability to the cp command:



mv </oldlocation/target> </newlocation/destination/>


Where the target is a file, or a directory, and the destination is a directory.



NOTE: If you use mv </location/filenameA> <location/filenameB> it will rename the file.
For example,



mv /etc/x11/xorg.conf /etc/x11/xorg.conf.backup


will rename the xorg.conf text file to xorg.conf.backup. Try doing a google search of useful linux command line tools.



Another neat trick in command line is using the 'man' option. For example



mv man


or



sudo man


The 'man' stands for manual. Every terminal application has a manual detailing the nature of the application, all of it's options, and definitions for everything. You can run the man option with any terminal command you install.


[#30073] Sunday, May 14, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wherejuic

Total Points: 53
Total Questions: 123
Total Answers: 117

Location: Zambia
Member since Mon, Jan 23, 2023
1 Year ago
wherejuic questions
Thu, Aug 19, 21, 18:07, 3 Years ago
Wed, May 12, 21, 03:23, 3 Years ago
Sat, Nov 13, 21, 05:27, 3 Years ago
Mon, Sep 5, 22, 17:36, 2 Years ago
;