[Baidu Linux Training Camp]

1. Linux Basics

Course address
Insert image description here

1.1 Operating system overview

  • Operating system (Operation system)
    The operating system is the interface between users and computers, as well as the interface between computer hardware and application programs. That is, we deal with the underlying computer hardware and applications through the operating system.

    VirtualBox download: https://www.virtualbox.org/
    CentOS download: http://isoredirect.centos.org/
    For details on the installation process, see the course video

1.1 Introduction to common directories

my environment
Insert image description here

[lighthouse@VM-8-7-centos /]$ ls

Insert image description here
Insert image description here

Insert image description here

2.Linux commands

Course Address
Course Content

  • Disk management
  • File management
  • Backup compression

2.1 Disk management

Insert image description here

2.1.1 Display and query

// ALL

ll

Insert image description here


ls -lh

Insert image description here


ls -a

Insert image description here


[root@VM-8-7-centos data]# ll -ah

Insert image description here

2.1.2 Directory

Insert image description here
[root@VM-8-7-centos data]# mkdir -p movies/himom 递归创建目录

递归删除目录
[root@VM-8-7-centos data]# rm -rf movies/
[root@VM-8-7-centos data]# ls
ppt_data  test_data  work_data

Creation and deletion of individual directories

[root@VM-8-7-centos data]# mkdir ok
[root@VM-8-7-centos data]# ls
movies  ok  ppt_data  test_data  work_data

[root@VM-8-7-centos data]# rmdir ok
[root@VM-8-7-centos data]# ls
movies  ppt_data  test_data  work_data

2.2 File management

Insert image description here

文件拷贝
cp 文件名 要复制的地址

Insert image description here

文件移动
mv 文件名 要移动到的地址
文件改名
mv 文件名 要改的文件名

Insert image description here

文件删除
rm  文件名

删除文件夹
rm -rf 文件夹

Insert image description here

Cat uses a file to stream the file to the screen, and cat 文件名>新的文件名a new file will be obtained.

An improved way of cat is to head/tail -n num 文件名view the num lines at the beginning/end of the file.


Linux file management-file difference comparison (diff)
diff A Bcomparing A and B
Insert image description here


File compression, two common classic compression methods are tar and zip

tar

  • Packtar -zcvf
  • Unzip tar -zxvf
    Insert image description here
    zip
  • Packzip
  • Unzipunzip
    Insert image description here

historyView historical operation commands
Insert image description here

3. Under Linux command

Course address
Insert image description here

3.1 Help command man

Insert image description here
For example, man lsview lsrelated information about.

3.2 User, user group and password management useradd, userdel, passwd

  1. useraddCreate user
useradd work
  1. userdeldelete users
userdel work
  1. passwdChange user password
  • Usage 1: Modify current user password->passwd
  • Usage 2: Modify the passwords of other users (only users with root permissions can)->passwd work

3.3 File and directory permission management chmod

Insert image description here
r-读 w-写 x-执行

3.3.1 Permission modification

Insert image description here

修改文件权限命令 ===> chmod 777 1.txt
递归修改文件权限命令 ===>chmod -R 777 a

Modify the owner and group
Insert image description here

修改归属人以及归属组
chown user:group fiename


递归修改该目录下全部文件
chown -R user:group dirname

File management
Insert image description here

aaaReplace everything in the filename file withbbb

sed -i 's/aaa/bbb/g' filename

Insert image description here

3.3.2 Text processing command awk

  1. Output in columns
awk '{print $2}' filename // 以空格为分隔符,输出第二列

awk '{print $NF}' filename // 以空格为分隔符,输出最后一列

awk -F 'a' '{print $2}' filename // 以a为分隔符,输出第二列

2.Support regular string matching

awk '$2~/th/{print $2,$4}' filename //第二列包含th时,输出第2、4列

3.3.3 Text editing

Insert image description here

command mode

Insert image description here
Insert image description here
Insert image description here

3.4 Linux search commands grep, find

Insert image description here

4. Section 4 Linux System Management

Insert image description here

4.1 Software package management

Insert image description here

CentOS package management

Insert image description here

Insert image description here

Ubuntu package management

Insert image description here

4.2 Network management

Insert image description here

4.3 Process management

Insert image description here

4.4 Disk management

Insert image description here
Insert image description here
Insert image description here
Insert image description hereInsert image description here

appendix

1. Dane development documentation
2. MacOS installation Homebrew
3. 50 most commonly used Unix/Linux commands
4. Alibaba Cloud CentOS-7-x86_64-DVD-2009.iso
5. Alibaba Cloud CentOS-8.3.2011-x86_64-dvd1 .iso
6. Han Shunping learned Linux in one week

Guess you like

Origin blog.csdn.net/Blue_Pepsi_Cola/article/details/131626656