博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
day04 - 02 linux简单的操作命令
阅读量:6906 次
发布时间:2019-06-27

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

man ls:查看ls的帮助文档ls --help:查看ls的帮助文档,简单查看help cd: 查看内置命令(man)不可以查看内置命令touch [filename]:创建一个文件pwd: 查看当前所在路径ls: 查看当前路径下包含的内容    -l  查看详细信息    -a  查看全部文件信息,包含隐藏文件    -h  人性化的查看信息(大小标注单位等)tty:查看当前的终端设备cat filename: 查看文件内容more filename: 查看文件部分内容mkdir dir: 创建一个名字为dir的文件夹    -p  递归创建文件目录mv file1 file2: 把file1移动到file2的位置tree CN:查看目录树结构cp: 复制mv: 剪切rm: 删除 -- 非常危险,Linux中没有回收站机制,通常将需要删除的文件单独放到一个目录中tar zcvf demo.tar.gz [filename] [filename]: 打包压缩多个文件du:查看但前目录大小(包含文件)    -sh 只看目录大小free -m:    查看空闲内存ip a: 查看ip地址useradd oldboy: 添加用户chown [用户].[用户组] [filename]: 修改文件用户权限chmod 777 [filename or dir]:    更改权限df: 查看盘符使用状态    [root@localhost ~]# df    Filesystem     1K-blocks    Used Available Use% Mounted on    注:分区                   已使用 可用    百分比   盘符     /dev/sda2       28528640 2433716  24639052   9% /    tmpfs             502172      80    502092   1% /dev/shm    /dev/sda1         289293   28455    245478  11% /boot    [root@localhost ~]# df -h    Filesystem      Size  Used Avail Use% Mounted on    /dev/sda2        28G  2.4G   24G   9% /    tmpfs           491M   80K  491M   1% /dev/shm    /dev/sda1       283M   28M  240M  11% /boottop: 类似于windows的任务管理器,q退出    参数:        user:用户进程所占的cpu        system:操作系统本身所占的cpu        idle:cpu空闲率        iowait:cpu等待io的时间比,每执行一次需要等io操作的时间        mem(Memory):            total:总内存量            usage:内存使用            free:内存空闲            cached(缓存):以后可能会用到的内存,目前并没有使用            buffered(缓冲区中):正在准备使用的内存        真正空闲空间 = free + cached + buffered            kill PID(进程号), 杀掉进程find 目录名: 查找文件    -name bubble  ,精确查询    -name *bubble*  ,文件名中包含bubble    -size n[cwbkMG]              File uses n units of space.  The following suffixes can be used:              ‘b’    for 512-byte blocks (this is the default if no suffix is used)              ‘c’    for bytes              ‘w’    for two-byte words              ‘k’    for Kilobytes (units of 1024 bytes)              ‘M’    for Megabytes (units of 1048576 bytes)              ‘G’    for Gigabytes (units of 1073741824 bytes)              The size does not count indirect blocks, but it does count blocks in  sparse              files  that are not actually allocated.  Bear in mind that the ‘%k’ and ‘%b’              format specifiers of -printf handle sparse files differently.  The ‘b’  suf-              fix  always  denotes  512-byte  blocks and never 1 Kilobyte blocks, which is              different to the behaviour of -ls.find / -size +90M |xargs ls -lh    | 管道符,找出大小为90+的数据后,执行后面的命令    r   read    读       4w   write   写       2x   excute  执行     1

 

转载于:https://www.cnblogs.com/alwaysInMe/p/6874319.html

你可能感兴趣的文章
Linux内核线程
查看>>
Linux cp时总询问是否覆盖,怎样让它不询问直接覆盖
查看>>
笨方法学python Lesson 45
查看>>
Java HashMap的实现原理
查看>>
服务器的发送数据
查看>>
kvm install 报错could not open disk imageXXX: Permission denied
查看>>
lduan office 365 自定义域的添加和配置二
查看>>
在Wordpress侧栏中使用下拉菜单显示分类
查看>>
基础排序算法 – 选择排序Selection sort
查看>>
Appium移动自动化测试环境部署
查看>>
corosync+pacemaker+crm实现drbd高可用
查看>>
Git Fork和PullRequest
查看>>
springBoot2.x设置quartz的overwriteExistingJobs参数
查看>>
VMware中通过克隆的Centos7,网卡突然没了
查看>>
学习笔记 DNS 子域授权 view
查看>>
stat函数
查看>>
在MyEclipse中部署项目到Tomcat服务器
查看>>
Kendo UI常用示例汇总(二十二)
查看>>
lnmp+coreseek实现站内全文检索(安装篇)
查看>>
六月技术指标和个人指标
查看>>