RH033读书笔记(12)-Lab 13 Finding and Processing Files
Sequence 1: Using find
Scenario: Log in as user student. Devise and execute a find command that produces
the result described in each of the following problems, then write down the
command in the space provided.
You may need to refer to the man page for find. Remember that you can search
man pages with /string.
You will encounter a number of Permission denied messages when
find attempts to recurse into directories to which you do not have read access -
do not be concerned about these messages. Better yet, you can suppress these
error messages by appending your find command with 2> /dev/null.
Instructions:
1. Produce a listing of everything under /var/lib owned by user rpm.
find /var/lib -user rpm 2> /dev/null
2. Produce a listing of everything under /var owned by user root and group mail.
find /var -user root -group mail 2> /dev/null
3. Produce an ls -l style listing of everything on the system not owned by users root, bin or
student
This will take a long time, so run the command in one terminal and do the next problem in
another terminal while it runs.
find / -not -user root -not -user bin -not -user student -ls 2> /dev/null
or
find / ! -user root ! -user bin ! -user student -ls 2>/dev/null
4. Produce an ls -l style listing of everything under /usr/bin with size greater than 50
kilobytes
find /usr/bin -size +50k -ls 2> /dev/null
5. Execute the file command on everything under /etc/mail
find /etc/mail -exec file {} \; 2> /dev/null
6. Produce an ls -l style listing of all symbolic links under /etc
Hint: man find and search for an option that searches for files by type
find /etc/ -type l -ls 2> /dev/null
7. Produce an ls -l style listing of all "regular" files under /tmp that are owned by user
student, and whose modification time is greater than 120 minutes ago.
Hint: man find and search for an option that searches by modification time in minutes
find /tmp -user student -mmin +120 -type f -ls 2> /dev/null
8. Modify the command above to find all "regular" files under /tmp that are owned by user
student, and whose modification time is greater than 120 minutes ago, and have find
prompt you interactively whether or not to remove each one. Because you are using the
interactive option, do not throw out error messages; that is, do not end your command with
2> /dev/null. Decline to remove all files when prompted.
find /tmp -user student -mmin +120 -type f -ok rm {} \;
Note: The standard error is not redirected in answer number 9 because that would prevent
the questions being asked by -ok from being displayed.
9. Produce a listing of all files under /bin and /usr/bin that have the SetUID bit set.
find /bin /usr/bin -perm -4000 2> /dev/null
or
find /bin /usr/bin -perm -u+s 2> /dev/null
RH033读书笔记(12)-Lab 13 Finding and Processing Files的更多相关文章
- RH033读书笔记(11)-Lab 12 Configuring the bash Shell
Sequence 1: Configuring the bash Shell Deliverable: A system with new aliases that clear the screen, ...
- RH033读书笔记(5)-Lab 6 Exploring the Bash Shell
Lab 6 Exploring the Bash Shell Sequence 1: Directory and file organization 1. Log in as user student ...
- RH033读书笔记(8)-Lab 9 Using vim
Lab 9 Using vim Sequence 1: Navigating with vim 1. Log in as user student 2. [student@stationX ~]$ c ...
- RH033读书笔记(16)-Lab 17 Installation and Administration Tools
Lab 17 Installation and Administration Tools Goal: Become familiar with system configuration tools a ...
- RH033读书笔记(10)-Lab 11 Process Control
Lab 11 Process Control Sequence 1: Job Control 1. [student@stationX ~]$ su - 2. Begin some jobs in t ...
- RH033读书笔记(15)-Lab 16 The Linux Filesystem
Lab 16 The Linux Filesystem Goal: Develop a better understanding of Linux filesystem essentials incl ...
- RH033读书笔记(2)-Lab 3 Getting Help with Commands
Lab 3 Getting Help with Commands Sequence 1: Using the Help Tools 1. man -f keyword whatis keyword l ...
- RH033读书笔记(4)-Lab 5 File Permissions
Lab 5 File Permissions Sequence 1: Determining File Permissions 1. What is the symbolic representati ...
- RH033读书笔记(3)-Lab 4 Browsing the Filesystem
Lab 4 Browsing the Filesystem Sequence 1: Directory and File Organization 1. Log in as user student ...
随机推荐
- JQuery插件datatables相关api
学习可参考:http://www.guoxk.com/node/jquery-datatables http://yuemeiqing2008-163-com.iteye.com/blog/20069 ...
- 西南民大oj(两园交求面积)
西南民大oj:http://www.swunacm.com/acmhome/welcome.do?method=index 我的几何不可能那么可爱 时间限制(普通/Java) : 1000 MS/ 3 ...
- SPARK如何使用AKKA实现进程、节点通信
SPARK如何使用AKKA实现进程.节点通信 <深入理解Spark:核心思想与源码分析>一书前言的内容请看链接<深入理解SPARK:核心思想与源码分析>一书正式出版上市 < ...
- Windows Phone开发人员必看资料
win phone开发必看资料,下载地址收藏啦!收藏后可有选择性的下载,希望大家喜欢! 完整附件下载:http://down.51cto.com/data/414417 附件预览: Windows E ...
- Django写的投票系统2(转)
在上一篇中 django实例:创建你的第一个应用投票系统(一) 已经介绍基本的功能,并已经启动服务了.这一节介绍数据库相关的东东. 首页打开mysite/settings.py配置文件, 设置数据库打 ...
- [Leetcode]-ReverseLinkedList
题目:单链表取反 #include <stdlib.h> #include <stdio.h> typedef struct node *list; typedef struc ...
- 在Button上、下、左、右位置加入图片和文字
转载请注明出处:http://blog.csdn.net/droyon/article/details/37564419 非常多人有如标题所述的需求,并且大多数人採用了自己定义组件攻克了需求,事实上还 ...
- ZooKeeper集群安装
ZooKeeper是Apache提供的.分布式服务协调系统,应用比較广泛. 由于项目中使用Kafka MQ,而Kafka全然使用ZooKeeper实现Kafka各组件的服务协调,包含Broker.Co ...
- JavaScript类数组对象参考
JavaScript和DOM中有很多类数组对象,它们有以下特点 1.有length属性 2.可以使用[]通过下标访问 3.部分类数组对象使用[]访问成员时不只可以使用下标,还可以使用id或name 4 ...
- Android中Dialog的使用
上一篇博文讲到对话框popWindow的使用,这篇博文主要解说Dialog的使用. 1.什么是Dialog? Dialog就是对话框的一种方式! 在Android开发中.我们常常会须要在Android ...