栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Linux命令行使用技巧及系统下文件管理(二)

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux命令行使用技巧及系统下文件管理(二)

Linux命令行使用技巧及系统下文件管理(二)

3.关于文件寻址的命令

pwd    显示当前的工作目录

[westos@westos_student73 Desktop]$cd		##切换当前的工作目录
[westos@westos_student73 Desktop]$cd -		##返回当前目录之前所在的目录	
[westos@westos_student73 Desktop]$cd ~-		##返回当前目录之前所在的目录,效果与"cd -"相同	
[westos@westos_student73 Desktop]$cd -		## -只是cd命令的用法,~-返回之前工作目录是通用的

[westos@westos_student73 Desktop]$..			##".."当前目录的上级目录
[westos@westos_student73 Desktop]$~				##默认代表当前用户家目录
[westos@westos_student73 Desktop]$~username		##指定的用户家目录
[westos@westos_student73 Desktop]$"~+" = "."	##当前目录
[westos@westos_student73 Desktop]$~-			##当前目录之前所在目录
[westos@westos_student73 Desktop]$..			##当前目录的上级目录

ls    显示文件信息

[westos@westos_student73 Desktop]$ls			##显示当前目录中子目录和子文件的名称
[westos@westos_student73 Desktop]$ls file		##显示指定文件的名称
[westos@westos_student73 Desktop]$ls dir		##显示指定目录中内容的名称
[westos@westos_student73 Desktop]$ls -d dir		##显示目录,本身的名称
[westos@westos_student73 Desktop]$ls -l file	##显示文件属性
[westos@westos_student73 Desktop]$ls -l dir		##显示目录中内容的属性
[westos@westos_student73 Desktop]$ls -ld dir	##显示目录本身属性
[westos@westos_student73 Desktop]$ls -a dir		##显示目录中所有文件名称包括隐藏文件名
[westos@westos_student73 Desktop]$ls -s			##显示文件大小
[westos@westos_student73 Desktop]$ls -R	dir		##递归显示目录中的内容

4.文件批处理

命令功能
*##匹配0~任意字符
##匹配单个字符
[[:alpha:]]匹配单个字母
[[:lower:]]匹配单个小写字母
[[:upper:]]匹配单个大写字母
[[:alpha:]]匹配单个字母
[[:alpha:]]匹配单个字母
[[:digit:]]匹配单个数字
[[:alnum:]]匹配单个数字或字母
[[:punct:]]匹配单个符号,比如@ #等等
[[:space:]]匹配单个空格



字符集合表示方法

[]   条件是或关系是,是模糊匹配,对象和几个对比匹配就操作几个
    [1-10]  1-10
    [!d-f] 或[^d-f] 除了d-f以外



{}    点名机制,精确指定到指定集合中的每一个元素
    {1…10}  1-10  {a…c}  a-c
    一次创建多个文件时要用点名机制,不能用模糊匹配

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/308904.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号