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

How to realize File Management by linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to achieve file management in linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1. Basic concepts of file system and Shell

1. The meaning of the file system

A file system is system software used to manage and organize data stored on disk drives.

File system of 2.Linux

The Linux system adopts virtual file system technology (VFS), the structure adopts inverted tree, and VFS enables Linux to support the following file systems:

EXT2: secondary expansion

EXT3: three extensions

SWAP: swap file system

FAT 、 FAT32

NTFS (not supported by default and requires specific modules)

VFAT: virtual FAT

SYSV: file system of Unix

HPFS: file system of OS/2

ISO9660: optical disk file system

NFS: network file system

File Classification in 3.Linux

(1) ordinary documents

Text file: ASCII encoding, editable, modifiable

Binary: not viewable, not modifiable

(2) Catalog files

The contents stored are the file names and subdirectory names in the directory

(3) equipment file (/ dev)

Used by users to access physical devices, divided into block devices and character device files

(4) Link file

Soft link files: target files and linked files can span index points, equivalent to shortcuts to files

Delete the original file, the symbolic link file loses its meaning

Delete symbolic link files without affecting the original file

Hard link file: link a file in the same index point, equivalent to a copy of the file

Two files point to the same storage area with the same content and length

Deleting one file does not affect other files

(5) Pipeline documents

FIFO cache queue

Main functions of 4.Shell

~ Command line interpretation

Interactive mode

Background operation

~ multiple execution sequences of commands

~ Command replacement (``)

~ Imap O redirection (>, >, f3

18. Cmp

Function: compare whether there are differences between the two files

Format: # cmp [parameters] File 1 File 2

Parameter:-l displays different byte positions

-s does not show the difference, only the return status

Example:

? # cmp f1 f2

# cmp-l F1 f2

18. Diff

Function: show the differences in the file

Format: # diff [parameters] File 1 File 2

Parameter:-c displays the full text and marks the differences

-u merge display and mark the differences

Example:

? # diff f1 f2

# diff-c F1 f2

19. Wc

Function: count the number of lines, words and characters in the file

Format: # wc [parameter] file name

Parameter:-c statistics of characters

-w count the number of words

-l count the number of rows

Example:

? # wc / etc/passwd

# wc-c / etc/passwd

Note:

1. Command to make up automatically

Press TAB key for automatic expansion

2. Command history

The Linux system uses a .history file to store the command history. Here are the operations related to the history:

! N: call the nth command in the positive order

!!: call the previous command

History: viewing command history

History-c: clear history

History-w file name: save history to the specified file

3. Command redirection

">": save the output of the command to the specified file. If the file does not exist, it will be overwritten.

"> >": save the output of the command to the specified file, and overwrite if the file is not created in advance.

"

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