【Linux 命令学习第三天】

生活都很不容易,依然要强颜欢笑,每个人都是演员,只有 付出汗水的才能美梦成真 成为影后!
前言:送个在风雨飘摇中依然坚持梦想的你

开始学习
linux环境 部署centos(VM/云主机)
博客
CRT Xshell window/MAC --》linux(安装时有界面,重启进入生产会话)
————————————————————–之前的叮嘱

查看ip
Window 输入 ipconfig 结果 172.31.181.161
Linux 输入 ifconfig 172.31.181.161
Ping hadoop000 /etc/host文件
[root@hadoop001 ~]# ping hadoop001
PING hadoop001 (172.31.181.161) 56(84) bytes of data.
64 bytes from hadoop001 (172.31.181.161): icmp_seq=1 ttl=64 time=0.023 ms
hostname -i
[root@hadoop001 ~]# hostname -i
172.31.181.161
[root@hadoop001 ~]# cat /etc/hosts
127.0.0.1 localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.31.181.161 hadoop001
如何找到IP
如何判断linux服务是否存活
进程ps -ef |grep httpd
端口号netstat -nlp |grep
第一步平xxx服务所在的机器ip。网络环境是通的
第二步查看xxx服务的端口号和服务地址
0.0.0.0:80 :::80 192.168.137.190:80
127.0.0.1;80 对本机可以使用.
第三步 telnet 192.168.137.190 80 ping IP和端口号是否接通
[root@hadoop001 ~]# yum install httpd
[root@hadoop001 ~]# telnet 172.31.181.161
Trying 172.31.181.161…
telnet: connect to address 172.31.181.161: Connection refuse
查看文件内容
Cat more less。
实时查看
tail -f xxx.log
tail -F xxx.log
-F==》-f retry不断的尝试
[root@hadoop001 ruozedata]# touch tam.log
[root@hadoop001 ruozedata]# ll
-rw-r–r-- 1 root root 0 Nov 14 20:25 tam.log
[root@hadoop001 ruozedata]# echo “wolcome" >>tam.log
[root@hadoop001 ruozedata]# cat tam.log
wolcome
Log4j 200M 10份
Jepson.log----》200M
Mv jepson.log jepson.log1
Touch jepson.log
这是窗口无显示
如何去寻找
系统命令cat 解决which cat
安装服务的命令
找文件和文件夹
find / -name ‘abc’全文搜索从根目录 特征abc
find ./ -name ‘abc’ 当前目录去搜索
find /tmp -name ‘abc’指定目录搜索
Vi
命令
q!强制退出 wq保存退出 wq!强制保存退出
gg第一行的第一个字符
G 最后一行的第一个字符
Shift+¥行尾
dd 删除当前一行
dG 删除当前一行及一下所有行
ndd删除光标一下的n
Shift+:/common 搜索出所以的common(n下键翻找,N上键)
set nu行号 set nonu 取消行号
清空文件
cat /dev/null>jepson.log
修改生产上面的配置的文件或者其他同志的文件
cp jepson.log jepson.log.123 先要复制一份
上传下载
将文件上传到window软件上
先下载这个软件yum install lrzsz
(上传win–》linux rz install.log
下载linux—>win) sz install.log
Editplus工具
查看文件大小
ll -h
du -sh xxx.log
文件夹大小
du -sh xxxd
系统情况命令
查看内存:free -m m是兆
查看硬盘:df -h
系统负载前情况:top
Load average: 0.00, 0.00, 0.00
———————1min 5min 15min
————>10表示系统繁忙
压缩解压
zip -r ruoze.zip ruozedata/*
unzip ruoze.zip
tar -czf ruoze.tar.gz ruozedata/*
tar -xzvf ruoze.tar.gz

结束:你没有显赫的背景,没有深厚的资本,穷的也只有努力了,如果你连它也放弃的话,那你将永远失败!我承认年轻是本钱 ,但是不努力,它不值钱!!!
————————送给那些还在深夜一样拼搏的朋友们
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43688472/article/details/84075847