博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux基础命令练习1
阅读量:7210 次
发布时间:2019-06-29

本文共 1508 字,大约阅读时间需要 5 分钟。

# ls -l | grep "^d"   

# cat /etc/ssh/sshd_config | grep -v  ^#

[^xx]  不包括xx

# ls -Fl  | grep /$

# grep   -Ev "^#|^$"   /etc/ssh/sshd_config

# egrep   -v "^#|^$"   /etc/ssh/sshd_config 

# find  . -type d ! -name "."

# find  . -type d ! -name "."  -prune

# tree -Ld  1

# ls -l | sed -n /^d/p

ls -l | awk '/^d/'

# ls -lF | sed -n '/\/$/p'

#find   -o    -and   !

^$空行

\

# cd -

当一个命令的输出,含有我们需要的内容的时候,我们要想到这个命令可能会有对应的参数直接显示,我们需要的内容。

# ll -lrt /etc/   最近时间的文件            (照着更新时间,反着排练文件)

# grep hequan  --color=auto   1.txt

# source /etc/profile  别名生效

#ln  硬链接      -s 软连接          目录          新的目录

# find ./  -type f -name "*.log"  -mtime  +7  | xargs rm -f

for n in `seq 100`; do sleep 1 ; echo $n >> /var/log/messages ;done 

# cat -n         #more   #less    :set nu :set  nonu  

# runlevel

more  less 

# ls /etc/rc.d/rc3.d/ | grep sshd

# grep -Ev "^#|^$"  /etc/inittab

# vi /etc/sysconfig/i18n 

echo    source     export

spacer.gif

# tar zcvf  /tmp/etc.tar.gz  /etc/   打包       筐  苹果 

# tar tf etc.tar.gz  看

# tar vxf   hequan.tar.gz   -C  /tmp/ 解包

 #tar zcfv  hequan.tar.gz     --exclude=/etc/ssh   /etc/        不包括

# tar zcvfX   hequan.tar.gz   a.txt /etc/

 # tar jcvf  hequan.tar.bz  /etc/

# tar jxvf  hequan.tar.bz

-N增量打包

# awk '{print $3 " " $6}'  hequan.txt

# cut -c 6-12,21- hequan.txt

# sed s#,##g  hequan.txt | awk  '{print $3" " $6}'

  

cut  -d  切割   -f数据选列,    -c按字符切割

# wc -l hequan.txt

# cat -n /etc/services  | tail -l 

# sed -n '$='  /etc/services

# awk  '{print NR }'  /etc/services   | tail -l

# ps -ef 

# ps -ef | grep sshd

# ps -ef | grep sshd | wc -l

# ps -ef |grep -v grep | grep sshd 

本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/1758200,如需转载请自行联系原作者
你可能感兴趣的文章
linux 系统负载高 如何检查
查看>>
TinyMCE 的音乐插件/mp3 music insert plugin
查看>>
批处理拷贝文件和文件夹
查看>>
简单账表二次开发添加自定义字段
查看>>
又找到安装Python第三方模块的好法子
查看>>
如何安装ioncube扩展对PHP代码加密
查看>>
自定义报表是这样实现的
查看>>
How to Convert Dynamic Disk to Basic Disk without Losing Data?
查看>>
Tomcat的安装
查看>>
Script:ASM修复脚本,寻找LISTHEAD和Kfed源数据
查看>>
ubuntu开机进入字符界面方法
查看>>
硬盘常见故障
查看>>
python 自动下载网站相关附件
查看>>
centos 6.5安装视频解码器
查看>>
Freeradius, 执行 radtest, 出现错误
查看>>
Android启动出现白屏的解决办法(theme)
查看>>
设计模式之单例设计模式
查看>>
LVS DR模型详解
查看>>
linux 源码安装Rabbitmq
查看>>
python 练习-登录接口
查看>>