硬着头皮学习linux系统[1day]

入门第一天—先从基本命令开始学习

linux系统命令

目录切换与文件的创建

这里是引用
在这里插入图片描述

文件夹属性解析

在这里插入图片描述

用户切换

在这里插入图片描述

目录的创建

在这里插入图片描述

文件拷贝与移动

在这里插入图片描述

软连接与硬链接解析

在这里插入图片描述

分析原因—新创建一个文件aaa

首先在我们查看一下aaa信息 gavin@Gavin:/tmp$ stat aaa File: aaa Size: 0
Blocks: 0 IO Block: 4096 regular empty file Device:
810h/2064d Inode: 36970 Links: 1 Access: (0644/-rw-r–r--)
Uid: ( 1000/ gavin) Gid: ( 1000/ gavin) Access: 2021-12-19
16:14:30.028057168 +0800 Modify: 2021-12-19 16:14:30.028057168 +0800
Change: 2021-12-19 16:15:39.438057141 +0800 Birth: - 发现有一个指针指向aaa
inode 为 36970

aaa中添加数据---->> gavin@Gavin:/tmp$ nano aaa gavin@Gavin:/tmp$ cat aaa
helloworld gavin@Gavin:/tmp$

查看aaa信息—> gavin@Gavin:/tmp$ stat aaa File: aaa Size: 11
Blocks: 8 IO Block: 4096 regular file Device: 810h/2064d
Inode: 36970 Links: 1 Access: (0644/-rw-r–r--) Uid: ( 1000/
gavin) Gid: ( 1000/ gavin) Access: 2021-12-19 16:58:47.578056137
+0800 Modify: 2021-12-19 16:58:14.748056150 +0800 Change: 2021-12-19 16:58:14.748056150 +0800 Birth: - gavin@Gavin:/tmp$

创建软连接---->> gavin@Gavin:/tmp$ ls aaa alink bbb blink
hsperfdata_root slink slinked

查看alink信息—> gavin@Gavin:/tmp$ stat alink File: alink -> aaa
Size: 3 Blocks: 0 IO Block: 4096 symbolic
link Device: 810h/2064d Inode: 40089 Links: 1 Access:
(0777/lrwxrwxrwx) Uid: ( 1000/ gavin) Gid: ( 1000/ gavin)
Access: 2021-12-19 16:59:06.488056130 +0800 Modify: 2021-12-19
16:59:05.138056130 +0800 Change: 2021-12-19 16:59:05.138056130 +0800
Birth: - gavin@Gavin:/tmp$

创建硬链接------>>

gavin@Gavin:/tmp$ ln aaa alinked gavin@Gavin:/tmp$ ls aaa alink
alinked bbb blink hsperfdata_root slink slinked gavin@Gavin:/tmp$

gavin@Gavin:/tmp$ stat alinked File: alinked Size: 11
Blocks: 8 IO Block: 4096 regular file Device: 810h/2064d
Inode: 36970 Links: 2 Access: (0644/-rw-r–r--) Uid: ( 1000/
gavin) Gid: ( 1000/ gavin) Access: 2021-12-19 16:58:47.578056137
+0800 Modify: 2021-12-19 16:58:14.748056150 +0800 Change: 2021-12-19 17:01:48.508056067 +0800 Birth: - gavin@Gavin:/tmp$ 再次查看aaa信息---->>>
gavin@Gavin:/tmp$ stat aaa File: aaa Size: 11 Blocks:
8 IO Block: 4096 regular file Device: 810h/2064d
Inode: 36970 Links: 2 Access: (0644/-rw-r–r--) Uid: ( 1000/
gavin) Gid: ( 1000/ gavin) Access: 2021-12-19 16:58:47.578056137
+0800 Modify: 2021-12-19 16:58:14.748056150 +0800 Change: 2021-12-19 17:01:48.508056067 +0800 Birth: - gavin@Gavin:/tmp$

在这里插入图片描述

两级目录的解析

linux种是不分盘符的,在安装好linux之后有两层目录,
在这里插入图片描述
在这里插入图片描述

PING的时候 ctrl c 结束ping

查看防火墙状态
[root@192 gavin]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 六 2021-12-25 04:50:55 PST; 35min ago
     Docs: man:firewalld(1)
 Main PID: 701 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─701 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

1225 04:50:54 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
1225 04:50:55 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
1225 04:50:55 localhost.localdomain firewalld[701]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure confi...t now.
Hint: Some lines were ellipsized, use -l to show in full.

关闭防火墙

关闭防火墙需要两步,第一步
移除防火墙服务,然后在关闭

[root@192 gavin]# systemctl disable firewalld  使得防火墙服务失效
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@192 gavin]# systemctl stasus firewalld
Unknown operation 'stasus'.
[root@192 gavin]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: active (running) since 六 2021-12-25 04:50:55 PST; 38min ago
     Docs: man:firewalld(1)
 Main PID: 701 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─701 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

1225 04:50:54 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
1225 04:50:55 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
1225 04:50:55 localhost.localdomain firewalld[701]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure confi...t now.
Hint: Some lines were ellipsized, use -l to show in full.
[root@192 gavin]# systemctl stop  firewalld 关闭防火墙


[root@192 gavin]# systemctl status firewalld  防火墙状态
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

1225 04:50:54 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
1225 04:50:55 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
1225 04:50:55 localhost.localdomain firewalld[701]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure confi...t now.
1225 05:29:33 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
1225 05:29:34 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@192 gavin]# 

配置网络的目的就是便于外部访问—注意虚拟机的网络链接模式要为NAT模式
配置结束后可以通过软件来操作linux了
在这里插入图片描述

文件的传输

借助一些ftp软件可以实现如xftp,
如果不借助外部软件,那么我们需要安装一个软件
lrzsz

zzy@localhost etc]$ sudo yum install lrzsz -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.bupt.edu.cn
 * extras: mirrors.bupt.edu.cn
 * updates: mirrors.bupt.edu.cn
Package lrzsz-0.12.20-36.el7.x86_64 already installed and latest version
Nothing to do
[zzy@localhost etc]$ 

之后传输文件----rz 然后选择发送到linux的文件

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_54061333/article/details/122247569
今日推荐