Linux Command file creation move Delete, linux Command creation move

Source: Internet
Author: User
Tags touch command

Linux Command file creation move Delete, linux Command creation move

Cat

[Function description]

Create a file

# The cat command is used to concatenate a file or display the file content. However, if you read data from the standard input device and redirect the result to a new file, you can create a new file. The Cat command can only receive data from the keyboard when editing a new file, but cannot edit the file content flexibly. Therefore, the flexibility is far inferior to the dedicated text editing tool and can only be used to create a simple file.

[Syntax format]

Cat [-- heip] [-- version] >|>> [file name]

[Option parameters]

Parameters

Description

-- Help

Show Help information and exit

-- Version

Show version information and exit

Ln

[Function description]

Create a connection file

# A symbolic connection file is a special file. With a small resource space, you can access files or directories in other directories. A symbolic link file includes a hard link and a soft link. A hard link is an inode (node) that points to the block where the file is stored, the newly created I node points to the same content as the original I node of my file. The soft link is to create a new independent file that points to the linked file, similar to the shortcut in win7

[Syntax format]

Ln [parameter] [-T] [Source File Link file]

Ln [parameter] [source file] []

Ln [parameter] [source file] [directory where the new linked file is located]

Ln [parameter] [-t] [directory where the new link file is located] [source file]

[Option parameters]

Parameters

Description

-B

Back up existing target linked files

-F

When the file is linked, delete the file with the same name in the same directory as the target file, regardless of the file type.

-I

Ask the user before overwriting existing files

-N

View soft links to directories as common files

-S

Create a soft link instead of a hard link for the source file

-T

Specifies the directory created by the linked file. By default, the linked file is created in the user's directory.

-V

Display Command Execution Process

-T

Treat linked files as common files

Mv

[Function description]

Move and rename a file

# Music videos can be used to rename and move files and directories.

[Syntax format]

Mv [parameter] [source file] [target file]

[Option parameters]

Parameters

Description

-B

If you need to overwrite the file, back up the file before overwriting.

-I

Interactive operation. If the mv operation causes overwriting of the existing target file, the system will ask whether to overwrite the existing file. the user will enter y or n to avoid false overwriting.

-F

Disable interactive operations. Do not give any prompts when the mv is overwritten.

-U

If the target file already exists and is consistent with the source file or newer than the source file, the file is not moved.

-V

Display the file name on the screen while moving each file

-S

Backup suffix character or string used together with the-B parameter, you can specify the backup file suffix string

Rm

[Function description]

Delete an object

English xxxx # When some files do not need to be deleted, you can use the rm command to permanently delete files from the hard disk. This command is generally used to delete files. For a linked file, the link is closed and the source file remains unchanged. The user needs the corresponding operation permissions during deletion.

[Syntax format]

Rm [parameter] [file or directory]

[Option parameters]

Parameters

Description

-I

Interactive deletion of target files

-F

In contrast to-I, when you delete a file, you are not prompted to forcibly delete it.

-R

Rm deletes all directories and subdirectories in the specified target file list. It can be used to delete non-empty directories.

-D

Change the hard link of the directory you want to delete to 0 and delete the directory. Note that only the Super User has this permission.

-V

Display Command Execution Process

Touch

[Function description]

# A special case of the touch command when creating a file. Touch is used to modify the access and modification time attributes of a specified file. If the specified file does not exist, a new empty file is created and the file access time is set.

[Syntax format]

Touch [-r <reference File>] [file name]

[Option parameters]

Parameters

Description

-R <reference File>

Use the time attribute of the reference file to set the new file, instead of the current default time.

 

I just want to make a summary. If any, please criticize and advise me.

Salute

Copyright Notice

All the content involved in this summary is excerpted from the Linux Command complete technical guide Zhang Dong

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.