dir

简要列出目录内容

语法

 `dir' (also installed as `d')

相当于 `ls -C -b’; 也就是说,默认情况下,文件列在列中,垂直排序,特殊字符由反斜杠转义序列表示

实例

使用dir命令列出目录内容

$ dir

显示隐藏文件

$ dir -a

不显示 … .

$ dir -A

区分文件和目录

$ dir -F

显示文件详细信息,默认只输出文件和目录的名称,可以使用 -l 显示详细信息(权限 作者 时间 等)

  $ dir -l

以人类可读的方式打印文件大小,“K”,“M”和“G”(千字节,兆字节和千兆字节)容易理解的大小符号显示此信息

  $  dir -h

dir显示反向排序

 $  dir -R

dir按文件大小排序输出

 $  dir -S

dir 命令实例:

linux命令:dir dir dirrootopen.com
linux命令:dir dir dirrootopen.com
2018-08-29 21:34:42

linux命令:dir=$(pwd); while [ ! -z "$dir" ]; do ls -ld "$dir"; dir=${dir%/*}; done; ls -ld / / -ld ls done; dir=${dir%/*}; "$dir"; -ld ls do ]; "$dir" -z ! [ while dir=$(pwd); dir=$(pwd); while [ ! -z "$dir" ]; do ls -ld "$dir"; dir=${dir%/*}; done; ls -ld /rootopen.com
linux命令:dir=$(pwd); while [ ! -z "$dir" ]; do ls -ld "$dir"; dir=${dir%/*}; done; ls -ld / / -ld ls done; dir=${dir%/*}; "$dir"; -ld ls do ]; "$dir" -z ! [ while dir=$(pwd); dir=$(pwd); while [ ! -z "$dir" ]; do ls -ld "$dir"; dir=${dir%/*}; done; ls -ld /rootopen.com
2017-12-31 22:20:48

linux命令:dir='path to file'; tar cpf - "$dir" | pv -s $(du -sb "$dir" | awk '{print $1}') | tar xpf - -C /other/path /other/path -C - xpf tar | $1}') '{print awk | "$dir" -sb $(du -s pv | "$dir" - cpf tar file'; to dir='path dir='path to file'; tar cpf - "$dir" | pv -s $(du -sb "$dir" | awk '{print $1}') | tar xpf - -C /other/pathrootopen.com
linux命令:dir='path to file'; tar cpf - "$dir" | pv -s $(du -sb "$dir" | awk '{print $1}') | tar xpf - -C /other/path /other/path -C - xpf tar | $1}') '{print awk | "$dir" -sb $(du -s pv | "$dir" - cpf tar file'; to dir='path dir='path to file'; tar cpf - "$dir" | pv -s $(du -sb "$dir" | awk '{print $1}') | tar xpf - -C /other/pathrootopen.com
2018-04-19 14:24:48

linux命令:dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p") )p") )) 1 + ) }" $1; print "{ awk | -l |wc $dir $(ls % $RANDOM $(( "$(echo -n |sed $dir $(ls man dir="/bin"; dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p")rootopen.com
linux命令:dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p") )p") )) 1 + ) }" $1; print "{ awk | -l |wc $dir $(ls % $RANDOM $(( "$(echo -n |sed $dir $(ls man dir="/bin"; dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p")rootopen.com
2018-06-01 19:08:48

linux命令:diruse /,/M/* .|sort .|sort /,/M/* diruse diruse /,/M/* .|sortrootopen.com
linux命令:diruse /,/M/* .|sort .|sort /,/M/* diruse diruse /,/M/* .|sortrootopen.com
2018-01-21 08:29:48

linux命令:dirname `pwd` `pwd` dirname dirname `pwd`rootopen.com
linux命令:dirname `pwd` `pwd` dirname dirname `pwd`rootopen.com
2018-05-12 22:23:48

linux命令:dir -C -1 -N -RNCCI /dir/ > file.csv file.csv > /dir/ -RNCCI -N -1 -C dir dir -C -1 -N -RNCCI /dir/ > file.csvrootopen.com
linux命令:dir -C -1 -N -RNCCI /dir/ > file.csv file.csv > /dir/ -RNCCI -N -1 -C dir dir -C -1 -N -RNCCI /dir/ > file.csvrootopen.com
2018-05-20 10:05:48

linux命令:dirname $(readlink -f ${BASH_SOURCE[0]}) ${BASH_SOURCE[0]}) -f $(readlink dirname dirname $(readlink -f ${BASH_SOURCE[0]})rootopen.com
linux命令:dirname $(readlink -f ${BASH_SOURCE[0]}) ${BASH_SOURCE[0]}) -f $(readlink dirname dirname $(readlink -f ${BASH_SOURCE[0]})rootopen.com
2018-05-31 04:31:48

linux命令:dir /ad /s /b /b /s /ad dir dir /ad /s /brootopen.com
linux命令:dir /ad /s /b /b /s /ad dir dir /ad /s /brootopen.com
2018-04-09 17:02:48

linux命令:dir=${PWD##*/}; rename "s/`ls -b1 | head -n1 | sed 's/.\{4\}$//'`/$dir/" -v * * -v 's/.\{4\}$//'`/$dir/" sed | -n1 head | -b1 "s/`ls rename dir=${PWD##*/}; dir=${PWD##*/}; rename "s/`ls -b1 | head -n1 | sed 's/.\{4\}$//'`/$dir/" -v *rootopen.com
linux命令:dir=${PWD##*/}; rename "s/`ls -b1 | head -n1 | sed 's/.\{4\}$//'`/$dir/" -v * * -v 's/.\{4\}$//'`/$dir/" sed | -n1 head | -b1 "s/`ls rename dir=${PWD##*/}; dir=${PWD##*/}; rename "s/`ls -b1 | head -n1 | sed 's/.\{4\}$//'`/$dir/" -v *rootopen.com
2018-02-10 08:48:48

linux命令:dir=/rom; a=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -cv '^[[:space:]]*#'); b=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -c '^[[:space:]]*#'); echo $((a+b)) lines = ${a} sloc [$((a*100/(a+b)))%] + ${b} comments [$((b*100/(a+b)))%] [$((b*100/(a+b)))%] comments ${b} + [$((a*100/(a+b)))%] sloc ${a} = lines $((a+b)) echo '^[[:space:]]*#'); -c egrep | \; '{}' cat -exec \*.sh -name $dir b=$(find '^[[:space:]]*#'); -cv egrep | \; '{}' cat -exec \*.sh -name $dir a=$(find dir=/rom; dir=/rom; a=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -cv '^[[:space:]]*#'); b=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -c '^[[:space:]]*#'); echo $((a+b)) lines = ${a} sloc [$((a*100/(a+b)))%] + ${b} comments [$((b*100/(a+b)))%]rootopen.com
linux命令:dir=/rom; a=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -cv '^[[:space:]]*#'); b=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -c '^[[:space:]]*#'); echo $((a+b)) lines = ${a} sloc [$((a*100/(a+b)))%] + ${b} comments [$((b*100/(a+b)))%] [$((b*100/(a+b)))%] comments ${b} + [$((a*100/(a+b)))%] sloc ${a} = lines $((a+b)) echo '^[[:space:]]*#'); -c egrep | \; '{}' cat -exec \*.sh -name $dir b=$(find '^[[:space:]]*#'); -cv egrep | \; '{}' cat -exec \*.sh -name $dir a=$(find dir=/rom; dir=/rom; a=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -cv '^[[:space:]]*#'); b=$(find $dir -name \*.sh -exec cat '{}' \; | egrep -c '^[[:space:]]*#'); echo $((a+b)) lines = ${a} sloc [$((a*100/(a+b)))%] + ${b} comments [$((b*100/(a+b)))%]rootopen.com
2018-05-11 10:48:48

Linux的Bash命令行(A-Z排序)