View
221
Download
2
Embed Size (px)
Citation preview
Chapter 8Files and User Information Utilities
Logical Partitions
referred to as file systems
like a drive in windows world
$ df (display filesystems) shows your logical partitions
most common are/usr, where binary and executables are stored
/opt, where third party applications are usually located
root (/), where the files that pertain to the operation of the system are kept
Finding Files
-name filename
-type filetype
-mtime [+|-]n
-atime [+|-]n
-user loginid
-group groupid
-perm mode
-size [+|-]n[c]
Finding Files
Finding Files
grep Command
search for pattern "rose” inside of text file “flowers”
$ grep rose flowers
looks for who is on server by piping who output to pattern search for user2
$ who | grep user2
CDE Finding Files
much like find on other GUI systems
specify where you want to search
what you want to search for
criteria much the same as with command line - "content" criteria is like grep command
Sorting
who Command
who by default displays information about all users currently logged on the local system
lists user’s name, terminal, login time, elapsed time since the last activity on the terminal line, and the machine (host) name
who -H prints headers above the info
who -q only lists users currently logged on and the total number
Switching Users
su (switch user) username switches to another user but doesn't change directory location
if you're root, you don't need the password
su - takes you into the user's environment - system reads new user's initialization files
as administrator, you can experience trouble AS the user to help troubleshoot
User ID
Real User ID (RUID) - initial loginEffective User ID (EUID) - who you are after the switchwho am i (only unix command with spaces in it) displays RUID with login info - if switched, still displays real user IDwhoami displays only the login name of the EFFECTIVE userid displays the effective user nameid -a identifies the effective user name, user ID, and user’s groups
Lab 8.2.4 – File Processing Commands (find, grep, sort)
Lab 8.3.3 – User Identification Commands
chapter 8 assessment
Labs/Assessment
1. find any files in your home directory named dante:
Chap 8 Exercises
1. find any files in your home directory named dante:
$ find . -name dante./dante
$ find ~/ -name dante/export/home/user2/dante
Chap 8 Exercises
2. look in this file: /etc/passwd for user2 home directory info
Chap 8 Exercises
2. look in this file: /etc/passwd for user2 home directory info
$ grep user2 /etc/passwduser2:x:1001:10::/export/home/user2:/bin/ksh
Chap 8 Exercises
3. sort the output of the long listing of your home directory
Chap 8 Exercises
3. sort the output of the long listing of your home directory
$ ls -l | sort
Chap 8 Exercises