grep -rl "python" ./ 查找./目录下文件名中包含python的文件 find | grep luoluo将当前目录下(包括子目录)的文件名中含有luoluo的文件过滤出来,即使是当前目录子目录下的文件,也能被找出来. find | xargs grep luoluo将当前目录下(包括子目录)的文件内容中含有luoluo的行过滤出来 ll | grep luoluo类似find | grep luoluo,只是不能递归查找子目录下的文件名 ls -l "*p…
以TexturePacker举例 MAC下用TexturePacker命令行打包当前目录下所有的 *.tps文件 1.配置好tps文件需要配置好路径.参数等.(也可不配置,用命令行实现.具体参考:https://www.codeandweb.com/texturepacker/documentation) 2.新建一个*.sh文件,内容填写 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && p…
如果只是想得到当前目录下(不包括子目录)的相关文件时:ls -l | grep  ".gz$" > 1.txt 如果想得到当前目录下,包括子目录中的相关文件时,应该用find命令: find ./ -type  f  -name "*.gz" > 1.txt 得到两个文件后如何进行对比,可以使用diff命令,例如: 将目录/usr/li下的文件"test.txt"与当前目录下的文件"test.txt"进行比较,输入…
在目录下所有文件中查找某个字符串(递归查) grep -rnl '字符串' 目录名 统计一个文件夹下目录数或文件数, 如下分步讲解: 1. 显示目录下内容: ls -l                 # 会以行形式列出所有一级内容, 普通文件义-开头, 目录以d开头 2. 递归显示目录下所有内容: ls -lR               # 递归列出所有内容, 形式同上 3. wc命令介绍: wc [-lwm]        # l表示行数; w表示英文单词数; m表示字符数 cat /a.…
###  列出当前目录下的所有目录: [root@localhost ~]# ls -ld * #列出所有的文件 drwxr-xr-x. root root Nov : elasticsearch drwxr-xr-x root root Apr : elasticsearch- -rw-r--r-- root root Apr : elasticsearch-.tar.gz -rw-r--r-- root root Mar : epel-release-latest-.noarch.rpm -…
注意:我启动的时候遇到脚本错误 » sh startup.sh -m standalone tanghuang@bogon : command not found : command not found : command not found: 'tartup.sh: line 19: syntax error near unexpected token `in 'tartup.sh: line 19: `case `uname` in 复制代码 这是因为在windows下编写的脚本文件,放到L…
1.find ./ -name "y*" 查找以y开头的文件. find ./ -name "*sql*" 查找包含 sql 的文件名 2.查找redis sudo find /* -name "*redis*" 3.列出gearman进程 ps -aux | grep gearman 4.查看一个文件下,所有文件夹的大小 du -sh * 5.查看某一个文件夹的大小 du -sh fileName…
find . -type f -name "edaijia* 结果:…
linux下通过rm命令来删除文件,但是如果要删除文件名乱码的文件,就不能直接使用rm命令了,因为压根就无法输出文件名来.不过借助find命令可以实现对其删除.在linux下对于每个文件都一个对应的不变的inode号,使用 ls -li 可以查看到文件的inode号,同时find可以根据inode号来查找,另外find命令中可以执行其他的命令.删除的步骤如下: 通过ls -li 获取要删除乱码文件名文件的inode号,比如得到的是 123456    执行删除 find ./ -inum 123…
在Linux下,当需要找某个文件但又不知道这个文件在哪个具体的目录下,这时可以使用全目录查找 使用find命令: find . -type f -name "job_21_output*" 结果:…