Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When I do this I end up with no such file or directory and permission denied could you tell me what i'm doing wrong? useadd

When I do this I end up with no such file or directory and permission denied could you tell me what i'm doing wrong?

useadd ashley useradd lynn

groupadd -g 150 uGroup1 groupadd -g 151 uGroup2

usermod -g uGroup1 ashley usermod -g uGroup2 lynn

vi sh1.sh

tail -2 /etc/passwd|cut -d: -f1,2,3,4,5,6,7

if test -d /home/ashley/usr

then

rm -r /home/ashley/usr

fi

mkdir /home/ashley/usr

if test -d /home/lynn/etc

then

rm -r /home/lynn/etc

fi

mkdir /home/lynn/etc

ls -l /home/ashley/usr|grep ^-|head -1

ls -l /home/lynn/usr|grep ^-|head -1

u1= `ls -1 /root|grep ^-|head -1|tr -s |cut -d -f 3`

echo $u1

g1= `ls -1 /root|grep ^-|head -1|tr -s |cut -d -f 4`

echo $g1

ls -R /usr>/home/ashley/usr/usrListing.txt

ls -R /etc>/home/lynn/etc/etcListing.txt

chown ashley:uGroup1 /home/ashley/usr/usrListing.txt

chown lynn:uGroup1 /home/lynn/etc/etcListing.txt

f1= `wc -c /home/ashley/usr/usrListing.txt|cut-d -f 1`

f2= `wc -c /home/lynn/etc/etcListing.txt|cut-d -f 1`

echo ashley file had $f1 bytes

echo lynn file had $f2 bytes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions