当前位置:网站首页>Rhcsa Road
Rhcsa Road
2022-07-06 20:17:00 【Omniscient magical conch】
the second day
cd Toggle directory
#cd chang directory Relative paths : Start searching relative to the current path cd home / root directory cd / ~ Current user's home directory . Current directory .. Top directory cd ../../.. - Last switched path
cd .. Represents a return to the previous level directory
cd ../.. Representatives return to the upper two levels , And so on
cd - Switch to the last directory you entered
su User switching
su USERNAME Switch to the specified user , The current path has not changed su Switch to root user su -l USERNAME == su - redhat Switch to the specified user , Change the current path and return to the current user's home directory
Shortcut key
ctrl+c Terminate the execution of the current order
ctrl+l Clear the screen == clear
ls List commands ( Look at all the files in the directory )
-l Long format displays the file and its properties ls -l == ll -d View the properties of the specified directory ll -d /root The list is /root Directory attribute information ll -d Displays the properties of the current directory -a Displays all files in the specified directory, including hidden files and . .. Current directory and upper level directory ls -l -a == ls -la == ll -a -A Displays all files in the specified directory, including hidden files -h File size conversion -i Display file inode Node number -R Recursively display all files in the current directory and nested Directory
choose term | function |
-l | Displays the details of files and directories in a long grid ,ls The command displays only the short format of the name by default . |
-d | Displays information about the specified directory itself , Instead of displaying the information of each file and subdirectory in the directory . |
-c | After sorting according to the modification time of the file , Display . |
-h | Show the size of a directory or file in a more user-friendly way , The default size is in bytes , Use -h Option will be displayed as K、M Equal unit . This option requires and -l Options can be used in combination to reflect the results . |
-R | Recursively displays all contents of the specified directory and its subdirectories . |
-a | Display information about all subdirectories and files , Include name to “.” Hidden directories and hidden files at the beginning , And the current directory ( .) And the upper level directory (..) Information about |
-A | And -a Options work similarly , However, it does not display... Representing the current directory “.” And... Representing the parent directory “..”. |
-i | Show file index node number (inode). An index node represents a file , stay linux Is saved in the disk partition All documents are assigned a number , Called the inode number inode. |
linux The basic idea is that everything is a document -----7 File types
- Plain text file d Directory file l Soft link file ( Shortcut ) b Block device file c Character device file p Pipeline files s socket Socket file 2-11 character Marked is the permission identifier Second column : Number of hard links The third column : Users The fourth column : Subordinate to the group The fifth column : file size The sixth column : File creation time or modification time The seventh column : file name
interview ----- The difference between soft link and hard link
stay linux In the file system , A file stored in a partition is assigned a number no matter what type it is , Called the inode number inode.
(1) Symbolic links are also called soft links , And the original file is not a file . for example Windows Shortcut to ,
Characteristics of action : Find a file in the specified path and access it quickly and easily , Delete source file shortcut cannot be accessed
Create objects : Text files and directory files can be created , And can cross file systems
Create link file :ln -s The original document Link to the file
How to determine whether it is a linked file : l
(2) Hard links ,
Concept : Multiple filenames point to the same Inode
Characteristics of action : Prevent users from deleting by mistake , Backup ( Backup only for file names )
Create objects : Cannot create for catalog file , And can't cross file systems
Create a hard link : ln The original document A new file
Whether multiple file names point to the same node number , And whether the number of hard links has changed
touch FILENAME create a file
mkdir DIRNAME Create directory
rm FILENAME Delete file
rm -r DIRNAME Delete directory files
cat FILENAME see file
nano FILENAME Edit the file
[[email protected] ~]#touch aaa Created... In the current path aaa file [[email protected] ~]#ln -s aaa a.lnk Yes aaa File creation shortcut file is called a.lnk [[email protected] ~]#nano aaa Edit file contents ctrl-x -- y - enter [[email protected] ~]#cat aaa see aaa The content of the document [[email protected] ~]#cat a.lnk [[email protected] ~]#rm aaa Delete aaa file [[email protected] ~]#rm a.lnk [[email protected] ~]#mkdir dir1 Create directory [[email protected] ~]#ln -s dir1 dir1.lnk [[email protected] ~]#rm -r dir1 notes : [[email protected] ~]#ln -s /root/dir /dir1.lnk take /root Under the dir Directory to create shortcut files in / Under the table of contents [[email protected] ~]#ln -s dir /dir2.lnk There is a problem ( take /dir Directory to create shortcut files in / Under the table of contents ) [[email protected] ~]# ll / lrwxrwxrwx. 1 root root 3 Feb 11 01:08 dir2.lnk -> dir
Creating hard links is only possible for text pieces [[email protected] ~]# touch b [[email protected] ~]# ln b bbb [[email protected] ~]# ll -i 33951783 -rw-r--r--. 2 root root 0 Feb 11 01:14 b 33951783 -rw-r--r--. 2 root root 0 Feb 11 01:14 bbb
*** File system hierarchy FHS
date
clock
hwclock -s The system time is synchronized to the hardware time
hwclock -w Hardware time is synchronized to system time
timedatectl status
list-timezones
set-timezone
set -time
Document management order
touch Create a text file
stat FILENAME View the detailed properties of the file
touch [-option...] FILENAME...
touch FILE1 FILE2 FILE3
touch /{FILE1,FILE2,FILE3}
touch {a..c}{1..3} a1 a2 a3 b1 b2 b3 c1 c2 c3
mkdir Create directory
mkdir [-options..] DIRNAME
-p parents Specify the parent directory to create ( Create multi-level directories from left to right )
-v verbose Details Displays the detailed results of the creation
Create multi-level directory mkdir -pv /1/2/3/4/5
tree Tree display directory structure
rm Delete file
rm [-options] FILENMAE/DIRNAME...
-f force mandatory
-r recursive , Delete directory files recursively
rm FILE1 FILE2
rm f* Delete with f All the documents at the beginning
rm *.txt
rm * Delete all text files in the current directory
rm -f
rm -r d1
rm -rf dd1
du View the disk size occupied by system files KB
-a View the total size of all files in the specified directory , The size of each file on the disk
-s Only the disk size occupied by all files in the specified directory is displayed , Don't show subdirectories
-h The display size can be converted into units
mv Moving files
mv [-options] The source file name ... The target path [[email protected] ~]# touch a [[email protected] ~]# ll -rw-r--r--. 1 root root 0 Feb 11 03:33 a [[email protected] ~]# mv a / [[email protected] ~]# ll / total 28 -rw-r--r--. 1 root root 0 Feb 11 03:33 a Move and rename [[email protected] ~]# mv f /file take f File move to / Directory and rename it file (file The file in / The directory does not exist ) File rename [[email protected] test]# mv a aaa
cp Copy file
cp [-options] The source file name ... The target path
-r Recursively copy directory files
-p Copy the file and keep the original properties of the file
-a== -rp Copy the directory and keep the original properties of the directory file
[[email protected] test]# cp -p /test/a /pub Copy /test/a File to /pub Catalog , Copy and keep the original properties of the file [[email protected] test]# ll /pub total 4 -rw-r--r--. 1 root root 10 Feb 11 03:25 a [[email protected] test]# cp -rp /test/d1 /pub [[email protected] test]# cp /test/a /pub/a.txt Copy /test/a File to /pub Directory and rename it a.txt [[email protected] test]# cp -r /test/d1 /pub/dir1
wget Download the file
wget [-option...] URL
-P Specify the download file to the specified path
-b Put the download process in the background
-c Breakpoint continuation
-t Specify the number of download attempts
-r Download catalog file
-o
-O
[email protected] test]# wget http://mirrors.163.com/centos/8/infra/x86_64/infra-common/Packages/a/awscli-1.18.156-1.el8.noarch.rpm --- hold awscli-1.18.156-1.el8.noarch.rpm Download to current path
[email protected] test]# wget http://mirrors.163.com/centos/8/infra/x86_64/infra-common/Packages/a/awscli-1.18.156-1.el8.noarch.rpm -P /pub hold awscli-1.18.156-1.el8.noarch.rpm Download to /pub Catalog
边栏推荐
- Continuous test (CT) practical experience sharing
- Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,
- JVM_ Common [interview questions]
- Tencent cloud database public cloud market ranks top 2!
- Notes on beagleboneblack
- Cesium Click to draw a circle (dynamically draw a circle)
- 数字三角形模型 AcWing 1018. 最低通行费
- Tencent byte Alibaba Xiaomi jd.com offer got a soft hand, and the teacher said it was great
- 为什么新手在编程社区提问经常得不到回答,甚至还会被嘲讽?
- mod_wsgi + pymssql通路SQL Server座
猜你喜欢
Leetcode question 283 Move zero
语音识别(ASR)论文优选:全球最大的中英混合开源数据TALCS: An Open-Source Mandarin-English Code-Switching Corpus and a Speech
Special topic of rotor position estimation of permanent magnet synchronous motor -- fundamental wave model and rotor position angle
Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
rt-thread i2c 使用教程
【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
BUUCTF---Reverse---easyre
5. 无线体内纳米网:十大“可行吗?”问题
Discussion on beegfs high availability mode
随机推荐
系统与应用监控的思路和方法
Introduction of Xia Zhigang
SSH connection denied
Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
Method keywords deprecated, externalprocname, final, forcegenerate
设计你的安全架构OKR
5. Nano - Net in wireless body: Top 10 "is it possible?" Questions
Appx代码签名指南
SQL injection 2
数据的同步为每个站点创建触发器同步表
【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
leetcode先刷_Maximum Subarray
Color is converted to tristimulus value (r/g/b) (dry stock)
报错分析~csdn反弹shell报错
Qinglong panel white screen one key repair
Number of schemes from the upper left corner to the lower right corner of the chessboard (2)
Tencent T3 Daniel will teach you hand-in-hand, the internal information of the factory
RT thread I2C tutorial
golang的超时处理使用技巧
5. Wireless in vivo nano network: top ten "feasible?" problem