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 ...
随机推荐
- Android-1-电话拨号程序
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjY1MTM4OQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...
- java多线程控制台聊天室(转)
用java多线程实现一个控制台聊天室,呵呵,好玩! 聊天室服务器端 package tf.thread; import java.io.BufferedReader; import java.io.I ...
- linux yum命令
1 安装yum install 全部安装yum install package1 安装指定的安装包package1yum groupinsall group1 安装程序组group1 2 更新和升级y ...
- zabbix监控nginx连接状态(转)
zabbix监控nginx zabbix可以监控nginx的状态,关于一个服务的状态可以查看服务本身的状态(版本号.是否开启),还应该关注服务能力(例如以nginx的负载效果:连接数.请求数和句柄数) ...
- ios UITableView 相关
1.tableView 实现的方法 无分组的cell #pragma mark - Table view data source - (NSInteger)tableView:(UITableView ...
- 第一章 andrid visdio 安装
第一章 andrid visdio 安装与环境搭建 一.Android Studio简介 Android Studio是Google新发布的Android应用程序开发环境,Android Stud ...
- ecshop 浏览历史样式的修改
ecshop的浏览历史的样式,例如我修改的是只让浏览历史显示浏览历史的商品名称 而不显示浏览历史的商品的价格和图片 首先找到要修改 的文件includes\lib_insert.php 找到函数fun ...
- Asp.Net2.0下C#环境 Login控件实现用户登录
原文:Asp.Net2.0下C#环境 Login控件实现用户登录 一.前台显示效果 二.前台代码 <asp:Login ID="Login1" run ...
- C语言 - printf的占位符(%) 异常
printf的占位符(%) 异常 本文地址: http://blog.csdn.net/caroline_wendy/article/details/26719135 C语言中, 使用%代表占位符的意 ...
- STM32W108无线传感器网络嵌入式uCOS-II的移植及实时环境监測
基于STM32W108无线开发板,将ucos-ii v2.86内核移植到其上,并加入用户任务.实现对温湿度.超声波.声音.光敏等传感器的控制及实时数据採集. 14.1开发环境说明 硬件:STM32W1 ...