Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
Unix командалық құралы
Unix command utility
Есептеу техникасында, cp – файлдар мен каталогтарды көшіруге арналған түрлі Unix және Unix-қа ұқсас операциялық жүйелердегі команда. Команданың үш негізгі жұмыс режимі бар, олар файлды басқа файлға, бір немесе бірнеше файлды каталогқа көшіру немесе толық каталогтарды басқа каталогқа көшіру үшін бағдарламаға берілген аргументтердің түрлері арқылы көрсетіледі. Бұл құрал сонымен қатар орындалатын операцияларды егжей-тегжейлі көрсету үшін түрлі командалық жол опцияларын қабылдайды. Екі негізгі стандарт POSIX cp және GNU cp болып табылады. GNU cp, POSIX нұсқасына қарағанда көптеген қосымша опцияларды қамтиды. Команда EFI қабығында да қолжетімді.
In computing, cp is a command in various Unix and Unix like operating systems for copying files and directories. The command has three principal modes of operation, expressed by the types of arguments presented to the program for copying a file to another file, one or more files to a directory, or for copying entire directories to another directory. The utility further accepts various command line option flags to detail the operations performed. The two major specifications are POSIX cp and GNU cp. GNU cp has many additional options over the POSIX version. The command is also available in the EFI shell.
Тарих
cp Unix-тің 1-ші нұсқасының құрамына кірген. GNU coreutils жинағындағы cp нұсқасын Торбьорн Гранлунд, Дэвид Маккензи және Джим Мейеринг жазған.
cp was part of Version 1 Unix. The version of cp bundled in GNU coreutils was written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
Жұмыс режимдері
cp-ның үш негізгі жұмыс режимі бар. Бұл режимдер бағдарлама шақырылғанда берілген аргументтердің түрі мен санына қарай анықталады. Егер бағдарламаға файлдардың жол атауларының екі аргументі берілсе, бағдарлама бірінші файлдың мазмұнын екінші файлға көшіріп, қажет болса екінші файлды жасайды. Егер бағдарламаға файлдардың жол атауларының бірі немесе бірнешесі берілсе, содан кейін каталогқа жол аргументі келсе, бағдарлама әрбір бастапқы файлды мақсатты каталогқа көшіріп, әлі жоқ файлдарды жасайды. Бағдарламаның аргументтері екі каталогтың жол атаулары болған жағдайда, cp бастапқы каталогтағы барлық файлдарды мақсатты каталогқа көшіріп, қажетті файлдар мен каталогтарды жасайды. Бұл жұмыс режимі үшін каталогтарды рекурсивті көшіруді көрсету үшін қосымша опция – әдетте «r» – қажет. Егер мақсатты каталогтан бұрыннан болса, бастапқы каталог мақсатты каталогқа көшіріледі, ал егер мақсатты каталог болмаса, жаңа каталог құрылады.
cp has three principal modes of operation. These modes are inferred from the type and count of arguments presented to the program upon invocation. When the program has two arguments of path names to files, the program copies the contents of the first file to the second file, creating the second file if necessary. When the program has one or more arguments of path names of files and following those an argument of a path to a directory, then the program copies each source file to the destination directory, creating any files not already existing. When the program's arguments are the path names to two directories, cp copies all files in the source directory to the destination directory, creating any files or directories needed. This mode of operation requires an additional option flag, typically r, to indicate the recursive copying of directories. If the destination directory already exists, the source is copied into the destination, while a new directory is created if the destination does not exist.