Linux—basic operation of file system and file directory

1. Partition and file system on Windows

New machine partitioning, formatting (select file system NTFS), understanding of hidden file system structure data file system. Analogy: country division, selection of management system

2. Windows file system features

(1) The file structure of Windows is multiple parallel tree structures, the top ones are different disks (partitions), such as: C, D, E and other disks, and the file paths all start from the drive letter

(2) The windows file system is all disk files or directories

(3) Windows file paths are case-insensitive

3. Linux file system directory

(1) Not all disk files are in the linux file system directory

In Linux, files are a very broad concept, such as text, pictures, and video files on disk; hardware devices, such as printers and terminal devices: /dev; some abstract concepts, such as pipelines: /proc, etc. Everything in linux is a file! !

(2) The Linux file structure is a single tree structure,

There are no C, D, E drive letters, everything starts from / (root directory)
insert image description here

4. View the disk partition of the linux system -------- use the df –ahT command

insert image description here

5. File name and special file

(1) Linux file name: case sensitive, no special extension

/opt/al and /opt/AI are 2 files

abc.txt is not necessarily a text document, just a file name without any meaning

(2) ls command ----- view files and directories

For example: ls; ls –a –l; (can be combined into ls -al)

-a show hidden files ls -l view file attribute information

(3) Linux special files

/ represents the root directory

. represents the current directory

. . Indicates the parent directory of the current directory

The .string indicates a hidden file, such as ".bash_profile" file

Usage: cd ... go to the parent directory of the current directory

6. Common directories of linux system

/ The root directory of the linux system

/etc system administration and configuration files

/home The user's home directory, for example, the home directory of the user user is /home/user

/boot The kernel files of the linux system are placed under this directory

/sbin System management commands, where the management programs used by system administrators are stored

/root system administrator's home directory

/bin Commonly used executable files, mainly cat, chmod, chown, date, mv, mkdir, cp, bash, etc. (basically all commands that can be operated in single-person maintenance mode)

/dev device file, such as /dev/cd0

/user User-level applications and files are almost all in this directory

which ls: find out which directory the ls command is stored in

/proc is a virtual file system, and the data placed is all in memory. For example: system core, process information (process), device status and network status, etc.

/tmp public storage point for temporary files, storing some temporary files

/lib some library files

View the command of the current path ----pwd

7. Absolute path and relative path

(1) Current directory (working directory): it is the directory where we (shell) are located

(2) When a user first logs in to the system, the current directory is the user's home directory (home directory)

The user's home directory is generated when the user is created, usually /home/username, for example: the home directory of user limin is /home/limin

(3) All files in the current directory can be accessed directly

Absolute path: starting from the root directory, followed by branches of the directory tree, until reaching the desired directory or file

Relative path: starting from the current directory, followed by branches of the directory tree, until reaching the desired directory or file

Change the current path command -----cd

Example: There is currently a path: /home/jcy/f1----f11-f111

—f112

—f113

----f12

----f13

Currently at f12, how to get to f112?

Absolute path: cd /home/jcy/f1/f11/f112

Relative path: cd .../f1/f11/f112

Lesson 4 Basic operations of files and directories

1. View the content of the text file

(1) cat command: view short files (long files will have a brushing effect)

(2) less command: long file

k ---- one line up

j ---- next line

Page up ----- up one page

Page down ---- next page

q ----- quit

2. ls command----view the contents of the current directory (without any parameters)

+ parameter (directory): list all content under the specified directory

+parameter –R : list everything including subdirectories

+parameter –l: list the detailed information of the file

3. Wildcards

All files, for example: ls *
g* files whose filename starts with g

b*.txt files that start with "b", have 0 or more characters in the middle, and end with ".txt"

Data??? Starts with "Data" followed by a 3-character file

[abc]* Files whose filename starts with "a", "b" or "c", for example: cat [ab]*

4. Create files and directories

(1) Create a file----vi, touch (touch creates an empty file)

(2) Create a directory ----mkdir (absolute path and relative path can be used)

Example: mkdir dir1 creates a single directory

mkdir dir1 dir2 dir3 Create multiple directories at the same time

mkdir -p /dir1/dir2/dir3 Create directories continuously

ps: touch can also modify the time of file creation

Example: touch + created file name (modify the time to the current operating time)

5. Copy files and directories ----cp

6. Move and rename files and directories----mv

(1) Renaming—the original address is the same as the destination address, which means renaming

(2) Move - the original address is different from the destination address

7. Delete files and directories----rm

rmdir ---- can only delete empty directories

rm -r ---- delete non-empty directory

Example: rm f1 delete f1 file

rm d1 –r delete directory d1

8. File link

(1) Soft link example: ln –s dog dog-soft creates a soft link for the dog file

(2) Hard link example: ln dog dog-hard creates a hard link for the dog file


              [The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled]


1. From entry to mastery of Python programming

2. Interface automation project actual combat

3. Actual Combat of Web Automation Project


4. Actual Combat of App Automation Project

5. Resume of first-tier manufacturers


6. Test and develop DevOps system

7. Commonly used automated testing tools


Eight, JMeter performance test

9. Summary (little surprise at the end)

life is long so add oil. Every effort will not be let down, as long as you persevere, there will be rewards in the end. Cherish your time and pursue your dreams. Don't forget the original intention, forge ahead. Your future is in your hands!

Life is short, time is precious, we cannot predict what will happen in the future, but we can grasp the present moment. Cherish every day and work hard to make yourself stronger and better. Firm belief, persistent pursuit, success will eventually belong to you!

Only by constantly challenging yourself can you constantly surpass yourself. Persist in pursuing your dreams and move forward bravely, and you will find that the process of struggle is so beautiful and worthwhile. Believe in yourself, you can do it!

Guess you like

Origin blog.csdn.net/nhb687096/article/details/131895000