dos2unix递归

.

0

linux命令:find . -type f -exec dos2unix {} + + {} dos2unix -exec f -type . find find . -type f -exec dos2unix {} +rootopen.com
linux命令:find . -type f -exec dos2unix {} + + {} dos2unix -exec f -type . find find . -type f -exec dos2unix {} +rootopen.com
wojo 2018-01-06 23:57:48
输出
linux命令:find 详解

评论

相关推荐

查看root文件下哪个目录占用了最多的空间非常有用

linux命令:find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n -n sort | {}" -sk du || {} -q "mountpoint -c sh {} -I xargs | d -type 1 -maxdepth / find find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -nrootopen.com
linux命令:find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n -n sort | {}" -sk du || {} -q "mountpoint -c sh {} -I xargs | d -type 1 -maxdepth / find find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -nrootopen.com
.

替换在文件夹中递归找到的一个或多个文件中匹配模式的字符串。

linux命令:find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \; \; {} 's/foo/bar/g' -e -i sed -exec "somefile.txt" -name f -type ./ find find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \;rootopen.com
linux命令:find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \; \; {} 's/foo/bar/g' -e -i sed -exec "somefile.txt" -name f -type ./ find find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \;rootopen.com
.

当运行完free i-node时,它可以用来确定文件数量最多的路径

linux命令:find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10 10 -n tail | -n sort | -c uniq | sort | 's@^\(.*\)/[^/]*$@\1@' sed | '^/\(dev\|proc\|run\|sys\).*' -regex ! f -type / find find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10rootopen.com
linux命令:find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10 10 -n tail | -n sort | -c uniq | sort | 's@^\(.*\)/[^/]*$@\1@' sed | '^/\(dev\|proc\|run\|sys\).*' -regex ! f -type / find find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10rootopen.com
.

Excludes other mountpoints with acavagni's "mountpoint" idea, but with -exec instead of piping to an xargs subshell. Then, calling "du" only once with -exec's "+" option. The first "\! -exec" acts as a test so only those who match are passed to the second "-exec" for du.

linux命令:find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -h -h sort | + {} -xsh du -exec \; {} -q mountpoint -exec \! -empty \! d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -hrootopen.com
linux命令:find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -h -h sort | + {} -xsh du -exec \; {} -q mountpoint -exec \! -empty \! d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -hrootopen.com
.

在示例中,查找并显示/etc中包含字符串nameserver的每个文件以及相应的行

linux命令:find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null 2>/dev/null 'nameserver' -Hn --color=AUTO grep -0 xargs | 2>/dev/null -print0 f -type /etc find find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/nullrootopen.com
linux命令:find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null 2>/dev/null 'nameserver' -Hn --color=AUTO grep -0 xargs | 2>/dev/null -print0 f -type /etc find find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/nullrootopen.com
.

linux命令:find . -depth -type d -empty -exec rmdir {} \; \; {} rmdir -exec -empty d -type -depth . find find . -depth -type d -empty -exec rmdir {} \;rootopen.com
linux命令:find . -depth -type d -empty -exec rmdir {} \; \; {} rmdir -exec -empty d -type -depth . find find . -depth -type d -empty -exec rmdir {} \;rootopen.com
.

将/home替换为您要搜索的位置

linux命令:find /home -xdev -samefile file1 file1 -samefile -xdev /home find find /home -xdev -samefile file1rootopen.com
linux命令:find /home -xdev -samefile file1 file1 -samefile -xdev /home find find /home -xdev -samefile file1rootopen.com
.

find 将输出所有目录 tac 颠倒了行的顺序,因此“leaf”目录首先出现 重新排序很重要,因为rmdir只删除空目录 我们将错误消息(关于非空目录)重定向到 /dev/null

linux命令:find . -type d | tac | xargs rmdir 2>/dev/null 2>/dev/null rmdir xargs | tac | d -type . find find . -type d | tac | xargs rmdir 2>/dev/nullrootopen.com
linux命令:find . -type d | tac | xargs rmdir 2>/dev/null 2>/dev/null rmdir xargs | tac | d -type . find find . -type d | tac | xargs rmdir 2>/dev/nullrootopen.com
.

恢复 gzip -cd path_to_save.cpio.gz | cpio -imV find . -xdev -print0 查找所有文件和目录,而不会越过其他分区,并打印出一个以空分隔的文件名列表 cpio -oa0V 从stdin获取要归档的文件列表,并创建一个保留时间戳和权限的归档文件 cpio -imV 从stdin中提取文件和目录,同时保留时间戳和权限

linux命令:find . -xdev -print0 | cpio -oa0V | gzip > path_to_save.cpio.gz path_to_save.cpio.gz > gzip | -oa0V cpio | -print0 -xdev . find find . -xdev -print0 | cpio -oa0V | gzip > path_to_save.cpio.gzrootopen.com
linux命令:find . -xdev -print0 | cpio -oa0V | gzip > path_to_save.cpio.gz path_to_save.cpio.gz > gzip | -oa0V cpio | -print0 -xdev . find find . -xdev -print0 | cpio -oa0V | gzip > path_to_save.cpio.gzrootopen.com
.

find path_to_dir -type f 打印目录树中的所有文件 chomp(@files = <>); 将所有行读入数组 stat($a)是一个有关文件的有趣信息的数组。索引7是大小,8是访问时间,9是修改时间等。(有关man perlfunc详细信息和搜索,请参阅stat EXPR。) sort { (stat($a))[9] <=> (stat($b))[9] } @files 按修改时间对文件进行排序 print scalar localtime((stat($f))[9]), "\t", $f, "\n" - 打印好格式化的修改时间,然后是选项卡和文件名

linux命令:find /path/to/dir -type f | perl -ne 'chomp(@files = <>); my $p = 9; foreach my $f (sort { (stat($a))[$p] <=> (stat($b))[$p] } @files) { print scalar localtime((stat($f))[$p]), "\t", $f, "\n" }' | tail tail | }' "\n" $f, "\t", localtime((stat($f))[$p]), scalar print { @files) } (stat($b))[$p] <=> (stat($a))[$p] { (sort $f my foreach 9; = $p my <>); = 'chomp(@files -ne perl | f -type /path/to/dir find find /path/to/dir -type f | perl -ne 'chomp(@files = <>); my $p = 9; foreach my $f (sort { (stat($a))[$p] <=> (stat($b))[$p] } @files) { print scalar localtime((stat($f))[$p]), "\t", $f, "\n" }' | tailrootopen.com
linux命令:find /path/to/dir -type f | perl -ne 'chomp(@files = <>); my $p = 9; foreach my $f (sort { (stat($a))[$p] <=> (stat($b))[$p] } @files) { print scalar localtime((stat($f))[$p]), "\t", $f, "\n" }' | tail tail | }' "\n" $f, "\t", localtime((stat($f))[$p]), scalar print { @files) } (stat($b))[$p] <=> (stat($a))[$p] { (sort $f my foreach 9; = $p my <>); = 'chomp(@files -ne perl | f -type /path/to/dir find find /path/to/dir -type f | perl -ne 'chomp(@files = <>); my $p = 9; foreach my $f (sort { (stat($a))[$p] <=> (stat($b))[$p] } @files) { print scalar localtime((stat($f))[$p]), "\t", $f, "\n" }' | tailrootopen.com
.

find path_to_dir -type d 找到所有子目录 tac 颠倒顺序。这对于使“leaf”目录成为第一位非常重要! target=... stuff构造新名称,删除空格并保持之前的所有内容相同 echo mv ... 为了安全起见,你应首先使用“echo”运行,如果输出看起来不错,则删除“echo”以真正执行重命名

linux命令:find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; done done "$target"; "$LINE" mv echo '); ' -d tr | "$LINE" "$LINE")/$(basename target=$(dirname do LINE; read while | tac | d -type /path/to/dir find find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; donerootopen.com
linux命令:find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; done done "$target"; "$LINE" mv echo '); ' -d tr | "$LINE" "$LINE")/$(basename target=$(dirname do LINE; read while | tac | d -type /path/to/dir find find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; donerootopen.com
.

linux命令:find <folder> -type f -exec sed -i 's/my big String/newString/g' {} + + {} String/newString/g' big 's/my -i sed -exec f -type <folder> find find <folder> -type f -exec sed -i 's/my big String/newString/g' {} +rootopen.com
linux命令:find <folder> -type f -exec sed -i 's/my big String/newString/g' {} + + {} String/newString/g' big 's/my -i sed -exec f -type <folder> find find <folder> -type f -exec sed -i 's/my big String/newString/g' {} +rootopen.com
.

linux命令:find "$(pwd)" -name "file-pattern*.gz" -exec zgrep -H 'pattern' {} \; \; {} 'pattern' -H zgrep -exec "file-pattern*.gz" -name "$(pwd)" find find "$(pwd)" -name "file-pattern*.gz" -exec zgrep -H 'pattern' {} \;rootopen.com
linux命令:find "$(pwd)" -name "file-pattern*.gz" -exec zgrep -H 'pattern' {} \; \; {} 'pattern' -H zgrep -exec "file-pattern*.gz" -name "$(pwd)" find find "$(pwd)" -name "file-pattern*.gz" -exec zgrep -H 'pattern' {} \;rootopen.com
.

当你在浏览器中观看像youku这样的flash视频时,视频文件会被保存在硬盘上的一个临时位置。而且,如果你在同一个窗口中观看一个视频和另一个视频,第一个视频就会被删除。 限制 可能不能与所有浏览器兼容。 不能处理所有网站(例如IMDB)。 无法与Chrome中的匿名窗口一起工作

linux命令:find /private/ 2>/dev/null | grep /Flash /Flash grep | 2>/dev/null /private/ find find /private/ 2>/dev/null | grep /Flashrootopen.com
linux命令:find /private/ 2>/dev/null | grep /Flash /Flash grep | 2>/dev/null /private/ find find /private/ 2>/dev/null | grep /Flashrootopen.com
.

linux命令:find / -iname *.jpg exec rm -rf {} \; \; {} -rf rm exec *.jpg -iname / find find / -iname *.jpg exec rm -rf {} \;rootopen.com
linux命令:find / -iname *.jpg exec rm -rf {} \; \; {} -rf rm exec *.jpg -iname / find find / -iname *.jpg exec rm -rf {} \;rootopen.com
.

linux命令:find / -name "*.jpg" -delete -delete "*.jpg" -name / find find / -name "*.jpg" -deleterootopen.com
linux命令:find / -name "*.jpg" -delete -delete "*.jpg" -name / find find / -name "*.jpg" -deleterootopen.com
.

删除断开的符号链接

linux命令:find -L . -type l -delete -delete l -type . -L find find -L . -type l -deleterootopen.com
linux命令:find -L . -type l -delete -delete l -type . -L find find -L . -type l -deleterootopen.com
.

-type f: 仅文件类型 -mtime +n: 文件的数据在n * 24小时前被修改 -name "*.log": 文件有扩展.log,可以替换其他单词 zip -m {}.zip: 将所有文件压缩成zip /dev/null &: 跳过打印屏幕

linux命令:find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null & & >/dev/null \; {} {}.zip -m zip -exec "*.log" -name +1 -mtime f -type . find find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null &rootopen.com
linux命令:find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null & & >/dev/null \; {} {}.zip -m zip -exec "*.log" -name +1 -mtime f -type . find find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null &rootopen.com
.

linux命令:find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u -u sort | m/\.([^.\/]+)$/' if $1 'print -ne perl | f -type . find find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -urootopen.com
linux命令:find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u -u sort | m/\.([^.\/]+)$/' if $1 'print -ne perl | f -type . find find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -urootopen.com
.

linux命令:find . -type f -exec grep -Iq . {} \; -exec grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" {} /dev/null \; \; /dev/null {} "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" -oE grep -exec \; {} . -Iq grep -exec f -type . find find . -type f -exec grep -Iq . {} \; -exec grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" {} /dev/null \;rootopen.com
linux命令:find . -type f -exec grep -Iq . {} \; -exec grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" {} /dev/null \; \; /dev/null {} "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" -oE grep -exec \; {} . -Iq grep -exec f -type . find find . -type f -exec grep -Iq . {} \; -exec grep -oE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" {} /dev/null \;rootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令