#mount -o umask=0002 /dev/sdd1 /sd
這樣 /sd 的權限會是:
rwxrwxr-x
umask 的 內容是 八進制,而且是 "not"。
所以 0002 就是不包含 other 的 write 權限。
所以 -o umask=0000 就是所有人,所有權限
#mount -o umask=0002 /dev/sdd1 /sd
rwxrwxr-x
if [ -f /etc/passwd ]; then
echo "found"
else
echo "not found"
fi
[ -e file ] file exists
[ -f file ] file is a file
[ -d file ] file is a directory
[ -c file ] file is a character device
[ -b file ] file is a block device
[ -p file ] file is a named pipe
[ -s file ] file is not empty
[ -k file ] file's sticky bit is set
[ -S file ] file is a socket
[ -L file ] file is a symbolic link
[ -r file ] file is readable by user
[ -w file ] file is writeable by user
[ -x file ] file is executeable by user
[ -O file ] file is owner by user
[ -G file ] file is group owned by a greoup
[ -u file ] file has its set user ID bit set
[ -g file ] file has its group user ID bit set
[ file1 -nt file2 ] file1 is newer than file2
[ file1 -ot file2 ] file1 is older than file2
[ file -ef file2 ] file1 is another name for file2
[ $str1 = $str2 ] str1 string is the same as string str2
-a and
-o or
! not
$ find . -name RefBase.cpp | xargs -I src cp src ~/test
set -e
set +e
find . -type f -not -path "./.repo*"
find . -type d -name Documentation -prune -o -type f -name '*.c'
-- 修剪掉所有 Documentation 目錄find . -type d \( -name Documentation -o -name tools -o -name scripts \) -prune -o -type f -name '*.c'
-- 修剪掉 Documentation, tools 和 scripts 三個目錄。
find . -type f -print
find . -print | xargs grep XXX
find . -type f -name '*.c' -print | xargs grep XXX
find . -type f -name '*.c' -o -name '*.h' -print | xargs grep XXX
find .-type f -name '*\.c' | xargs grep 'system_properties\.h
./system/core/init/init.c:#include <sys/system_properties.h>
./system/core/init/parser.c:#include <sys/_system_properties.h>
./system/core/init/property_service.c:#include <sys/_system_properties.h>
./build/tools/check_prereq/check_prereq.c:#include <sys/system_properties.h>
find . -type f -name '*\.c' | xargs grep 'system_properties\.h' | xargs cut -f1 -d ':'
./system/core/toolbox/watchprops.c
./system/core/toolbox/getprop.c
./system/core/libcutils/properties.c
./system/core/init/init.c
./system/core/init/parser.c
./system/core/init/property_service.c
./build/tools/check_prereq/check_prereq.c
... 最後加上 | xargs touch
${PWD}
export PATH=${PWD}/mytool:${PATH}
cmd='ls a1'
${cmd}
var=a1
cmd='ls ${var}'
${cmd}
var=a1
cmd="ls ${var}"
${cmd}