Find all writable files in the current directory

后端 未结 10 475
[愿得一人]
[愿得一人] 2020-12-25 11:47

I want to quickly identify all writable files in the directory. What is the quick way to do it?

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-25 12:38

    for  var in `ls`
    do
    if [ -f $var -a -w $var ]
    then
    echo "$var having write permission";
    else
    echo "$var not having write permission";
    fi
    done
    

提交回复
热议问题