A
Answers
Exercise 1 Solution
- /etc/passwd. Holds information concerning the account name, user ID, group ID, home directory, and shell.
- /etc/shadow. Holds the encrypted password for the corresponding account name in /etc/passwd as well as password and account-aging information.
- /etc/group. Identifies the different groups available for accounts.
Exercise 2 Solution
# adduser -c "C Jane Doe " -d /export/home/jdoe -e 2005/05/31-f 10 -g employees -G info_tech_1, info_tech_2, info_tech_5 -m -s /bin/ksh -u 1000 jdoe # passwd jdoe Changing password for user jdoe. New UNIX password: Retype UNIX password: passwd: all authentication tokens updated successfully. #
Exercise Solution
chmod 755 samplefile
Exercise 1 Solution
PS1="[\d \u]$"
Exercise 2 Solution
Find the executable file for this program. Add its directory to the value of the PATH variable, as in PATH=$PATH:/newdirectory.
Exercise 3 Solution
Add the command to the appropriate run control file for your preferred shell.
Exercise Solution
ls /home/k* | wc > k-users-files
Exercise 1 Solution
If you press the Esc key twice, you know you are in command mode.
Exercise 2 Solution
In command mode, type either / computer or ? computer to search for the word computer moving forward or backward respectively. (Be sure to put a space before and after the “computer” string if you want to find only instances of the complete word.) To continue the search in the opposite direction, type ...
Get Beginning Unix now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.