19
Chapter 8 Files and User Information Utilities

Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

  • View
    221

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Chapter 8Files and User Information Utilities

Page 2: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 3: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Finding Files

-name filename

-type filetype

-mtime [+|-]n

-atime [+|-]n

-user loginid

-group groupid

-perm mode

-size [+|-]n[c]

Page 4: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Finding Files

Page 5: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Finding Files

Page 6: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 7: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 8: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Sorting

Page 9: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 10: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 11: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 12: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

Lab 8.2.4 – File Processing Commands (find, grep, sort)

Lab 8.3.3 – User Identification Commands

chapter 8 assessment

Labs/Assessment

Page 13: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

1. find any files in your home directory named dante:

Chap 8 Exercises

Page 14: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

1. find any files in your home directory named dante:

$ find . -name dante./dante

$ find ~/ -name dante/export/home/user2/dante

Chap 8 Exercises

Page 15: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

2. look in this file: /etc/passwd for user2 home directory info

Chap 8 Exercises

Page 16: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

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

Page 17: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

3. sort the output of the long listing of your home directory

Chap 8 Exercises

Page 18: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)

3. sort the output of the long listing of your home directory

$ ls -l | sort

Chap 8 Exercises

Page 19: Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)