awk '{print $0}'说明

l0=`ls -l /home/portal/test1|awk '{print $0}'`  #显示文件的详细信息
ll=`ls -l /home/portal/test1|awk '{print $1}'`  #显示文件权限
l2=`ls -l /home/portal/test1|awk '{print $2}'`  #
l3=`ls -l /home/portal/test1|awk '{print $3}'`  #显示当前用户
l4=`ls -l /home/portal/test1|awk '{print $4}'`  #显示users
l5=`ls -l /home/portal/test1|awk '{print $5}'`  #显示byte大小
l6=`ls -l /home/portal/test1|awk '{print $6}'`  #显示更新时间
l7=`ls -l /home/portal/test1|awk '{print $7}'`  #显示当前时间
l8=`ls -l /home/portal/test1|awk '{print $8}'`  #显示文件所在目录
l9=`ls -l /home/portal/test1|awk '{print $9}'`  #null
l10=`ls -l /home/portal/test1|awk '{print $10}'`  #null
l11=`ls -l /home/portal/test1|awk '{print $11}'`  #null
echo "l0 value is $l0"
echo "ll value is $ll"
echo "l2 value is $l2"
echo "l3 value is $l3"
echo "l4 value is $l4"
echo "l5 value is $l5"
echo "l6 value is $l6"
echo "l7 value is $l7"
echo "l8 value is $l8"
echo "l9 value is $l9"
echo "l10 value is $l10"
echo "ll1 value is $l11"

输出信息如下:
l0 value is -rwxr-xr-x 1 portal users 870 2011-02-17 17:31 /home/portal/test1  
ll value is -rwxr-xr-x
l2 value is 1
l3 value is portal
l4 value is users
l5 value is 870
l6 value is 2011-02-17
l7 value is 17:31
l8 value is /home/portal/test1
l9 value is 
l10 value is 
ll1 value is

你可能感兴趣的:(Linux)