Linux查找命令

文章目录

find(查找文件或目录的路径)

sh 复制代码
# 在/home目录下,寻找名字是hi.txt的文件或目录的路径
find /home -name hi.txt
# 在/home目录下,寻找用户名称是jack的文件或目录的路径
find /home -user jack
# 在/home目录下,寻找大于10M的文件(单位K,M,G, +号代表大于,-号代表小于,无符号代表等于)
find /home -size +10M

which(查找指令的路径)

sh 复制代码
# 查找ls指令的路径
which ls

grep(查找指定内容的行内容)

sh 复制代码
# 查找hi.txt文件中包含hello的所有行的内容
cat hi.txt | grep hello
相关推荐
C_心欲无痕2 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6002 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston3 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20183 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟3 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston4 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式4 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode4 小时前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务4 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php
码农小韩5 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法