avatar
unix commands question# Unix - 噫吁兮,危乎高哉
b*s
1
What command removes the read and write permissions for everyone
except the owner of a file named "myfile"? All other permissions should
remain the same.
What command prints out the amount of space used by every file or
subdirectory in the current directory (except hidden files)?
du -s?
What command would you use to remove all the .o files from the current
directory and all directories at all levels below the current directory?
pretty confused about regular expressions here.
thanks a million
avatar
w*r
2

chmod og-rw myfile
du -k in kb
rm `find . -name "*.o"`

【在 b***s 的大作中提到】
: What command removes the read and write permissions for everyone
: except the owner of a file named "myfile"? All other permissions should
: remain the same.
: What command prints out the amount of space used by every file or
: subdirectory in the current directory (except hidden files)?
: du -s?
: What command would you use to remove all the .o files from the current
: directory and all directories at all levels below the current directory?
: pretty confused about regular expressions here.
: thanks a million

avatar
p*s
3

chmod go-rwx myfile
du -s *
find . -name '*.o' -exec rm {} \; -print

【在 b***s 的大作中提到】
: What command removes the read and write permissions for everyone
: except the owner of a file named "myfile"? All other permissions should
: remain the same.
: What command prints out the amount of space used by every file or
: subdirectory in the current directory (except hidden files)?
: du -s?
: What command would you use to remove all the .o files from the current
: directory and all directories at all levels below the current directory?
: pretty confused about regular expressions here.
: thanks a million

avatar
c*t
4
For the second question, the answer I think should be
ls -lR
du is for directories only.

【在 w******r 的大作中提到】
:
: chmod og-rw myfile
: du -k in kb
: rm `find . -name "*.o"`

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。