Wednesday, November 5, 2008

Freebsd Hw3_1_1

Requirement:

Write a script that prints the required lines of the following commands' results. Only print the lines which contains "current user".

a. fstat
b. sockstat
c. last
d. ps aux
e. cat /etc/passwd

Complete all five commands in the script called "hw3_1_1.sh"


Solution:




#!/bin/bash/
fstat | grep $USER
sockstat | grep $USER
last | grep $USER
ps aux | grep $USER
cat /etc/passwd | grep $USER

0 comments:

Post a Comment