Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Notes on the principles and applications of Unix-Chapter V General document 1

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Display and create file command: cat (usually only text file contents are displayed)

Common options explain:-v: display non-print characters;-n: display line numbers

Create a file: enter the cat command, followed by the > character, and then enter a file name after it and press ctrl+d to end the entry

Purpose: create files, display file contents, link files, add content to the end of the file, and apply it to the stream.

The input to the Cat command can come from a file or from the output of other commands.

File copy command: cp

Principle: it can be used to copy a set of files, which generates an image of the source file on disk, but with a different file name.

Note: if the target file does not exist, create it before copying it.

Cp is often associated with "." Symbols are used together to copy files to the current directory. The following two commands are equivalent

For example: cp / home/sharma/.profile .profile

Cp / home/sharma/.profile.

The command is optional:

-I: interactive replication;-R: copy directory tree

Cp-R progs newprogs

Note: the correct execution of the above cp depends on the existence of the newprogs directory. If it does not exist, the cp command creates this directory and its subdirectories. But if it does, progs will copy into a subdirectory of newprogs and produce a completely different result.

Warning: sometimes files cannot be copied using the cp command, possibly because the source files are read-protected or the destination files and directories are write-protected.

File deletion command: rm

Usage: rm can only delete files, not directories

Note: whether you can delete a file is not determined by the permissions of the file, but by the permissions of the directory in which it is located.

The command is optional:-I: delete files interactively;-rUniverse: delete files recursively;-f: force deletion

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report