使用文件(1)查看设备信息

文件(1)可以打印有关/ dev /目录中某些设备的详细信息(本例中为块设备)。这帮助我一眼就知道我的引导程序的位置和修订版本,UUID,文件系统状态,哪些分区是初级/逻辑等等,而不运行几个命令。参见:file -s / dev / dm- * file  - s / dev / cciss / *等。
.

0

linux命令:file -s /dev/sd* /dev/sd* -s file file -s /dev/sd*rootopen.com
linux命令:file -s /dev/sd* /dev/sd* -s file file -s /dev/sd*rootopen.com
vkyx 2018-01-06 17:59:48
输出
linux命令:file 详解

评论

相关推荐

flash插件的最新版本通过标记临时文件已删除来隐藏临时文件。实际上,视频流被下载到一个“已删除的文件”中。但是,即使删除了文件,如果进程打开了文件,那么您也可以找到它的文件描述符,从而找到文件内容 这个简单的脚本打印出已打开的Flash视频的文件描述符: file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: 而且,您可能希望从文件描述符创建常规文件,例如: cp $(file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: | head -n 1) video.avi 无论什么浏览器,该方法都应该有效

linux命令:file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: -d: -f1 cut | Flash grep | 2>/dev/null /proc/*/fd/* file file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:rootopen.com
linux命令:file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: -d: -f1 cut | Flash grep | 2>/dev/null /proc/*/fd/* file file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:rootopen.com
.

Bash快捷键与最后一个命令的最后一个参数一起工作

linux命令:file !$ !$ file file !$rootopen.com
linux命令:file !$ !$ file file !$rootopen.com
.

假设你想在命令'top'上执行'file'(确定它是什么类型的文件);但是你不知道'top'所在的位置:在=和zsh前面加上参数会隐含地预先设置路径。

linux命令:file =top =top file file =toprootopen.com
linux命令:file =top =top file file =toprootopen.com
.

获取没有扩展名的文件,将ASCII和utf-8作为“text / plain”

linux命令:file -i * | grep 'text/plain' | wc -l -l wc | 'text/plain' grep | * -i file file -i * | grep 'text/plain' | wc -lrootopen.com
linux命令:file -i * | grep 'text/plain' | wc -l -l wc | 'text/plain' grep | * -i file file -i * | grep 'text/plain' | wc -lrootopen.com
.

linux命令:file -i * | grep -c 'text/plain' 'text/plain' -c grep | * -i file file -i * | grep -c 'text/plain'rootopen.com
linux命令:file -i * | grep -c 'text/plain' 'text/plain' -c grep | * -i file file -i * | grep -c 'text/plain'rootopen.com
.

下一次你看到一个mac fanboy吹嘘10.6的64位度给他这个,所以他可能会sh?

linux命令:file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl |tail -1 |cut -f1 -f3 && file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -v x86_64 |nl |tail -1 |cut -f1 -f3 -f3 -f1 |cut -1 |tail |nl x86_64 -v |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file && -f3 -f1 |cut -1 |tail |nl x86_64 -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl |tail -1 |cut -f1 -f3 && file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -v x86_64 |nl |tail -1 |cut -f1 -f3rootopen.com
linux命令:file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl |tail -1 |cut -f1 -f3 && file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -v x86_64 |nl |tail -1 |cut -f1 -f3 -f3 -f1 |cut -1 |tail |nl x86_64 -v |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file && -f3 -f1 |cut -1 |tail |nl x86_64 -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl |tail -1 |cut -f1 -f3 && file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -v x86_64 |nl |tail -1 |cut -f1 -f3rootopen.com
.

这个命令为您提供了一个文本文件的字符集,如果您不知道编码的话,这将很方便。

linux命令:file -i <textfile> <textfile> -i file file -i <textfile>rootopen.com
linux命令:file -i <textfile> <textfile> -i file file -i <textfile>rootopen.com
.

没有你想象的那么遥远,现在呢? - 可爱的变形金刚迷

linux命令:file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl | tail -1 | cut -f1 -f3; file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i "mach-o object i386" |nl | tail -1 | cut -f1 -f3 -f3 -f1 cut | -1 tail | |nl i386" object "mach-o -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file -f3; -f1 cut | -1 tail | |nl x86_64 -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl | tail -1 | cut -f1 -f3; file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i "mach-o object i386" |nl | tail -1 | cut -f1 -f3rootopen.com
linux命令:file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl | tail -1 | cut -f1 -f3; file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i "mach-o object i386" |nl | tail -1 | cut -f1 -f3 -f3 -f1 cut | -1 tail | |nl i386" object "mach-o -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file -f3; -f1 cut | -1 tail | |nl x86_64 -i |grep /System/Library/Extensions/*.kext/Contents/MacOS/* file file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i x86_64 |nl | tail -1 | cut -f1 -f3; file /System/Library/Extensions/*.kext/Contents/MacOS/* |grep -i "mach-o object i386" |nl | tail -1 | cut -f1 -f3rootopen.com
.

您在设置路径目标的终点设置文件/ dirname传输变量,此命令使用管道视图显示进度,压缩文件outut并考虑更改ssh密码。支持带空格的dirnames。通过http://www.commandlinefu.com/commands/view/4379/copy-working-directory-and-compress-it-on-the-fly-while-showing-progress获得想法和意见。 http://www.commandlinefu.com/commands/view/3177/move-a-lot-of-files-over-ssh

linux命令:file='path to file'; tar -cf - "$file" | pv -s $(du -sb "$file" | awk '{print $1}') | gzip -c | ssh -c blowfish user@host tar -zxf - -C /opt/games /opt/games -C - -zxf tar user@host blowfish -c ssh | -c gzip | $1}') '{print awk | "$file" -sb $(du -s pv | "$file" - -cf tar file'; to file='path file='path to file'; tar -cf - "$file" | pv -s $(du -sb "$file" | awk '{print $1}') | gzip -c | ssh -c blowfish user@host tar -zxf - -C /opt/gamesrootopen.com
linux命令:file='path to file'; tar -cf - "$file" | pv -s $(du -sb "$file" | awk '{print $1}') | gzip -c | ssh -c blowfish user@host tar -zxf - -C /opt/games /opt/games -C - -zxf tar user@host blowfish -c ssh | -c gzip | $1}') '{print awk | "$file" -sb $(du -s pv | "$file" - -cf tar file'; to file='path file='path to file'; tar -cf - "$file" | pv -s $(du -sb "$file" | awk '{print $1}') | gzip -c | ssh -c blowfish user@host tar -zxf - -C /opt/gamesrootopen.com
.

这是一种肮脏的原始方式,简单地列出文件夹中的ELF对象。输出已准备好解析,即剥离器或其他需要ELF对象的路径。

linux命令:file /usr/bin/* | grep ELF | cut -d":" -f1 -f1 -d":" cut | ELF grep | /usr/bin/* file file /usr/bin/* | grep ELF | cut -d":" -f1rootopen.com
linux命令:file /usr/bin/* | grep ELF | cut -d":" -f1 -f1 -d":" cut | ELF grep | /usr/bin/* file file /usr/bin/* | grep ELF | cut -d":" -f1rootopen.com
.

文件显示文件类型-L标志意味着遵循sym-links(因为库通常与另一个对象相连,所以这种行为可能是首选)更复杂的行为(* 2 * grep命令!)可用于确定文件是不是共享库。

linux命令:file -L <library> | grep -q '64-bit' && echo 'library is 64 bit' || echo 'library is 32 bit' bit' 32 is 'library echo || bit' 64 is 'library echo && '64-bit' -q grep | <library> -L file file -L <library> | grep -q '64-bit' && echo 'library is 64 bit' || echo 'library is 32 bit'rootopen.com
linux命令:file -L <library> | grep -q '64-bit' && echo 'library is 64 bit' || echo 'library is 32 bit' bit' 32 is 'library echo || bit' 64 is 'library echo && '64-bit' -q grep | <library> -L file file -L <library> | grep -q '64-bit' && echo 'library is 64 bit' || echo 'library is 32 bit'rootopen.com
.

如果你想更新你的motd,可以安装在root crontab中。如果不是在Ubuntu上,你需要将/ usr / share / cowsay / cows / *更改为牛文件的位置。

linux命令:files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`" "`fortune`" ${#files}]}"` % "${files[RANDOM "%s\n" `printf -f files=(/usr/share/cowsay/cows/*);cowsay files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`"rootopen.com
linux命令:files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`" "`fortune`" ${#files}]}"` % "${files[RANDOM "%s\n" `printf -f files=(/usr/share/cowsay/cows/*);cowsay files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`"rootopen.com
.

该命令将通过服务器下载$文件。我在办公室打破FTP时使用了这个功能,我需要下载一些软件包。

linux命令:file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; ssh server "wget $file -O -" > $PWD/${file##*/} $PWD/${file##*/} > -" -O $file "wget server ssh file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; ssh server "wget $file -O -" > $PWD/${file##*/}rootopen.com
linux命令:file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; ssh server "wget $file -O -" > $PWD/${file##*/} $PWD/${file##*/} > -" -O $file "wget server ssh file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; ssh server "wget $file -O -" > $PWD/${file##*/}rootopen.com
.

这个沉重的单行文件获取“/ music / dir /”目录中的所有文件,并过滤非44.1 mp3文件。这样做后,它将名称传递给sox以便重新采样这些文件。原来的文件留在以防万一。

linux命令:file /music/dir/* | grep -v 44.1 | sed 's/:.*//g' | grep .mp3 | { while IFS= read; do filebak="\"$REPLY.original\""; file="\"$REPLY\""; mv $file $filebak; sox -t mp3 $filebak $file rate 44k; done; }; }; done; 44k; rate $file $filebak mp3 -t sox $filebak; $file mv file="\"$REPLY\""; filebak="\"$REPLY.original\""; do read; IFS= while { | .mp3 grep | 's/:.*//g' sed | 44.1 -v grep | /music/dir/* file file /music/dir/* | grep -v 44.1 | sed 's/:.*//g' | grep .mp3 | { while IFS= read; do filebak="\"$REPLY.original\""; file="\"$REPLY\""; mv $file $filebak; sox -t mp3 $filebak $file rate 44k; done; };rootopen.com
linux命令:file /music/dir/* | grep -v 44.1 | sed 's/:.*//g' | grep .mp3 | { while IFS= read; do filebak="\"$REPLY.original\""; file="\"$REPLY\""; mv $file $filebak; sox -t mp3 $filebak $file rate 44k; done; }; }; done; 44k; rate $file $filebak mp3 -t sox $filebak; $file mv file="\"$REPLY\""; filebak="\"$REPLY.original\""; do read; IFS= while { | .mp3 grep | 's/:.*//g' sed | 44.1 -v grep | /music/dir/* file file /music/dir/* | grep -v 44.1 | sed 's/:.*//g' | grep .mp3 | { while IFS= read; do filebak="\"$REPLY.original\""; file="\"$REPLY\""; mv $file $filebak; sox -t mp3 $filebak $file rate 44k; done; };rootopen.com
.

将一个postscript文件分成多个postscript文件。对于输入文件的每个页面,将生成一个输出文件。这些文件将被编号,例如1_orig.ps 2_orig.ps ... psselect commad是psutils包的一部分

linux命令:file=orig.ps; for i in $(seq `grep "Pages:" $file | sed 's/%%Pages: //g'`); do psselect $i $file $i\_$file; done done $i\_$file; $file $i psselect do //g'`); 's/%%Pages: sed | $file "Pages:" `grep $(seq in i for file=orig.ps; file=orig.ps; for i in $(seq `grep "Pages:" $file | sed 's/%%Pages: //g'`); do psselect $i $file $i\_$file; donerootopen.com
linux命令:file=orig.ps; for i in $(seq `grep "Pages:" $file | sed 's/%%Pages: //g'`); do psselect $i $file $i\_$file; done done $i\_$file; $file $i psselect do //g'`); 's/%%Pages: sed | $file "Pages:" `grep $(seq in i for file=orig.ps; file=orig.ps; for i in $(seq `grep "Pages:" $file | sed 's/%%Pages: //g'`); do psselect $i $file $i\_$file; donerootopen.com
.

注意:1)-n-1表示排序键是最后一个字段2)-l对于每个单独的记录在新行上(通常对于文本文件都是如此)而言很重要3)-j告诉msort不要创建日志文件(msort。日志)在工作目录中4)可能需要安装msort package.5)msort会做更多。检查男人msort

linux命令:file /bin/* | msort -j -l -n-1 -n2 2> /dev/null /dev/null 2> -n2 -n-1 -l -j msort | /bin/* file file /bin/* | msort -j -l -n-1 -n2 2> /dev/nullrootopen.com
linux命令:file /bin/* | msort -j -l -n-1 -n2 2> /dev/null /dev/null 2> -n2 -n-1 -l -j msort | /bin/* file file /bin/* | msort -j -l -n-1 -n2 2> /dev/nullrootopen.com
.

取一个文件夹并将其分割成包含最大文件数的较小文件夹。在这种情况下,每个directory.find创建100个文件创建filesxargs列表,将每个组的列表分成100个组,创建一个目录并复制到文件中注意:如果文件名中有空白,则此命令将不起作用(但然后再次,也没有替代命令:-)

linux命令:files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; done done $f; $l cp $((++f)); mkdir do l; read while | -n100 xargs | f -type files files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; donerootopen.com
linux命令:files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; done done $f; $l cp $((++f)); mkdir do l; read while | -n100 xargs | f -type files files -type f | xargs -n100 | while read l; do mkdir $((++f)); cp $l $f; donerootopen.com
.

linux命令:files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $files $files 's/old/new/g;' -e -i -p perl && \;) {} a -l grep -exec *.txt -name /dir/file files=$(find files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $filesrootopen.com
linux命令:files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $files $files 's/old/new/g;' -e -i -p perl && \;) {} a -l grep -exec *.txt -name /dir/file files=$(find files=$(find /dir/file -name *.txt -exec grep -l a {} \;) && perl -p -i -e 's/old/new/g;' $filesrootopen.com
.

替代基本名称使用grep来提取文件名

linux命令:fileName() { echo "$1" | grep -o "[^/]*$"; } } "[^/]*$"; -o grep | "$1" echo { fileName() fileName() { echo "$1" | grep -o "[^/]*$"; }rootopen.com
linux命令:fileName() { echo "$1" | grep -o "[^/]*$"; } } "[^/]*$"; -o grep | "$1" echo { fileName() fileName() { echo "$1" | grep -o "[^/]*$"; }rootopen.com
.

替代基本名称使用grep来提取文件名

linux命令:fileName(){ echo ${1##*/}; } } ${1##*/}; echo fileName(){ fileName(){ echo ${1##*/}; }rootopen.com
linux命令:fileName(){ echo ${1##*/}; } } ${1##*/}; echo fileName(){ fileName(){ echo ${1##*/}; }rootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令