Baidu Linux training camp
1. Linux Basics
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
[lighthouse@VM-8-7-centos /]$ ls
2.Linux commands
Course Address
Course Content
- Disk management
- File management
- Backup compression
2.1 Disk management
2.1.1 Display and query
ll
ls -lh
ls -a
[root@VM-8-7-centos data]# ll -ah
2.1.2 Directory
[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
文件拷贝
cp 文件名 要复制的地址
文件移动
mv 文件名 要移动到的地址
文件改名
mv 文件名 要改的文件名
文件删除
rm 文件名
删除文件夹
rm -rf 文件夹
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 B
comparing A and B
File compression, two common classic compression methods are tar and zip
tar
- Pack
tar -zcvf
- Unzip
tar -zxvf
zip - Pack
zip
- Unzip
unzip
history
View historical operation commands
3. Under Linux command
3.1 Help command man
For example, man ls
view ls
related information about.
3.2 User, user group and password management useradd, userdel, passwd
useradd
Create user
useradd work
userdel
delete users
userdel work
passwd
Change 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
r-读 w-写 x-执行
3.3.1 Permission modification
修改文件权限命令 ===> chmod 777 1.txt
递归修改文件权限命令 ===>chmod -R 777 a
Modify the owner and group
修改归属人以及归属组
chown user:group fiename
递归修改该目录下全部文件
chown -R user:group dirname
File management
aaa
Replace everything in the filename file withbbb
sed -i 's/aaa/bbb/g' filename
3.3.2 Text processing command awk
- 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
command mode
3.4 Linux search commands grep, find
4. Section 4 Linux System Management
4.1 Software package management
CentOS package management
Ubuntu package management
4.2 Network management
4.3 Process management
4.4 Disk management
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