Linux(三)

**

Linux基础命令

**
[root@localhost xixi]# cat passwd 查看passwd(小文件)
在这里插入图片描述
[root@localhost xixi]# more passwd 查看passwd
在这里插入图片描述
[root@localhost xixi]# less passwd 查看大文件
在这里插入图片描述
[root@localhost xixi]# head passwd 查看前十行
在这里插入图片描述
[root@localhost xixi]# tail passwd 查看倒数十行
在这里插入图片描述
[root@localhost xixi]# head -3 passwd 查看前三行
在这里插入图片描述
[root@localhost xixi]# tail -3 passwd 倒数三行
在这里插入图片描述
[root@localhost xixi]# cat -n passwd 查看有多少行
在这里插入图片描述
[root@localhost xixi]# head -11 passwd | tail -7 管道符,5-11行
在这里插入图片描述
[root@localhost xixi]# head -11 passwd | tail -6 | tail -3 | head -1
前11行的后6行的后3行的第一行
在这里插入图片描述
[root@localhost xixi]# head -11 passwd | tail -6 | tail -3 | head -1 | cut -d : -f 1
前11行的后6行的后3行的第一行 以:分割 的第一个单词
在这里插入图片描述
[root@localhost xixi]# head -11 passwd | tail -6 | tail -3 | head -1 | cut -d : -f 6
前11行的后6行的后3行的第一行 以:分割 的第六个单词
在这里插入图片描述
[root@localhost xixi]# head -11 passwd | tail -6 | tail -3 | head -1 | cut -d : -f 6 | cut -d / -f 2
前11行的后6行的后3行的第一行 以:分割 的第六个单词 再以/分割的第二个单词
在这里插入图片描述
[root@localhost xixi]# echo 现在时间是 date
在这里插入图片描述
[root@localhost xixi]# echo 现在时间是 date | cut -d : -f 1 | cut -d " " -f 4
在这里插入图片描述
[root@localhost xixi]#cat hehe
在这里插入图片描述
[root@localhost xixi]#sort hehe 排序
在这里插入图片描述
[root@localhost xixi]#sort -u hehe 把重复的去掉
在这里插入图片描述
[root@localhost xixi]#wc hehe
在这里插入图片描述
[root@localhost xixi]#history 命令历史管理器
在这里插入图片描述
[root@localhost xixi]#echo "The current directory is KaTeX parse error: Expected 'EOF', got '#' at position 30: …localhost xixi]#̲echo 'The curre…(date +%H-%M-%S).txt
在这里插入图片描述
[root@localhost xixi]#chgrp redhat hehe 改变组属性
[root@localhost xixi]#chown redhat hehe改变主属性
在这里插入图片描述
[root@localhost xixi]#chmod a-x 拿掉所有人的x权限
在这里插入图片描述
[root@localhost xixi]#chmod u-x 拿掉该用户的x权限
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值