• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/149

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

149 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)
The four main components of hardware are:

a) Software
b) RAM
c) CPU
d) OS
e) I/O
f) Hard disk
b) RAM
c) CPU
e) I/O
f) Hard disk
What are the three main components of the Solaris OS?
1) Kernal
2) Shell
3) Directory Hierarchy
What man command option prints out one-line summaries that contain any of the given keywords.

a) -k keyword
b) -p argument
c) -s keyword
d) -o argument
a) -k keyword
Arrange the terms below to show the correct syntax of a command:

Arguments Command Options
Command Options Arguments
What is the command that will display the information about the OS and workstation name.
uname -a
Man page DESCRIPTION:
This utility prints information about the current system on the standard output. When options are specified, symbols representing one or more system characteristics will be written to the standard output. If no options are specified, the utility prints the current operating system's name.
Using the -k option with the man command, find the man page that describes how to clear a terminal window (use the keyward clear) How do you enter this command on on the command line?
man -k clear
Arrange the systax for the copy command in the correct order.

a) Target
b) cp
c) Sources
d) -options
bdca

or

cp -options Sources Target
What option prevents accidental overwrites when copying, deleting or moving files.
-i

Interactive. cp prompts for confirmation whenever the copy would overwrite an existing target. A y answer means that the copy should proceed. Any other answer prevents cp from overwriting target.
cp prompts for confirmation whenever the copy would overwrite an existing target. A y answer means that the copy should proceed. Any other answer prevents cp from overwriting target.
For the word count command "wc" what are the correct options for the descriptions below?

-Option Description
a) -? Line Count
b) -? Word Count
c) -? Byte Count
d) -? Character Count
a) -l
b) -w
c) -c
d) -m
Arrange the syntax for the lp command in the correct order.

a)Options
b)Filename
c)lp
c a b

lp options filenames
Options for the lp command:

What option sends a mail message to you after the print job is complete?
-m
You are sending the file "/export/home/user1/reports" to be printed to printer6 which is not the default printer. Correctly format the print command you would use.
lp -d printer6 /export/home/user1/reports
lp is the command to print.

/export/home/user1/reports is the file you want to print

printer6 is the printer you want to print to, but is not the default printer.
You want to print six copies of the file ~/user1/reports to the default printer, Printer1, with no banner page. How would you correctly format that command?
lp -o nobanner -n 6 ~/user1/reports

or

lp -n 6 -o nobanner ~/user1/reports
The lpstat command displays the status for the printer queue. Describe the options for the lpstat command below.

What is the option for each Description?
a) Displays the status of all printers.
b) Displays the status of all output requests.
c) Displays the system default printer.
d) Displays the complete status info for all printers.
e) Displays a status summary for all printers
f) Displays which printers are accepting requests.
a) -p
b) -o
c) -d
d) -t
e) -s
f) -a
a) all printers
b) output requests
c) default printer
d) complete status (3 t's)
e) status summary
f) accepting requests

Or PODTSA = Papers Out Dont Try Sending Anything.
mkdir -p test_dir/alfa_dir/RATS

What dose the -p option do in the command above.
With this option mkdir creates a directory by creating all the non-existing parent directories first.
Using one command, create three directories named dir1, dir2 and dir3 in the current directory.
mkdir dir1 dir2 dir3
Create a file named myfile that is a symbolic link to the file /export/home/user1/file1.
ln -s /export/home/user1/file1 myfile
A hard link is created with the ln command.
The vi editor is a command-line editor that has three basic modes of operation. What are the three modes?
Command mode.
Edit mode.
Last line mode.
What are the seven input commands for the vi editor.

Hint: The 7th input command inserts text from another file into the current file.

For even more hints press “h”.
a
A
i
I
o
O
:r filename
You can append, insert, and open new lines with the vi editor. All these commands switch the vi editor from the Command mode to the Edit mode.
What will the commands below do in vi?

/exp
?exp
/exp Go forward to exp
?exp Go backward to exp
Search functions in the vi editor.

exp is just a string that can be searched.
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) :3, 8d
b) :4, 9m 12
c) :2, 5t 13
d) :5, 9w file
a) Delete lines 3 through 8.
b) Move lines 4 through 9 to line 12.
c) Copy line 2 through 5 to line 13.
d) Write lines 5 through 9 to file.
Delete, move, copy and write text in the vi editor.
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) :w! newfile
b) :e!
a) Write absolutely to the new file.
b) Re-edit current file and discard buffer. (Throw everything away and start over with the current file name)
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) :set nu
b) :set nonu
c) :set all
d) :set list
--Extra Credit--
e) :set wm=5
a) Display line numbers.
b) Turn off line numbers.
c) Show all settings
d) Display invisible characters
--Extra Credit--
e) Wrap lines five spaces from right margin
Control edit session
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) w
b) b
a) Go forward 1 word
b) Go backward 1 word
Word Movement
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) 0 (zero)
b) $
c) G
a) Go to line start
b) Go to end of line
c) Go to last file line (end of file)
Screen line movement
What will the commands below do in the vi editor? Assume The editor was in last line mode and you just performed a search for the word "dog".

a) n
b) N
a) Repeat previous search (Search wrapped around BOTTOM of buffer)
b) Reverse previous search (Search wrapped around TOP of buffer)
Search Functions
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) u
b) . (dot)
a) Undo last change
b) Do last change again
Cancel edit function
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) y
b) 5y
c) p
d) P
a) Yank a copy
b) Yank a copy of 5 lines
c) Put below the cursor
d) Put above the cursor
Copy and insert text
What will the commands below do in the vi editor? Assume The editor is in command mode.

a) cw
b) 3cw
c) C
d) r
e) R
a) Changes a word
b) Changes three words
c) Changes line
d) Replace one character
e) Replace / Type over a line
Change text
In vi editor from the command mode what is the command to search for the word "dog" and replace it with the word "cat" globally?
:%s/dog/cat/g
What type of metacharacters simplify location changes within the directory hierarchy.

Extra Credit: What are the metacharacters and what do the represent. Answers are in the hint section.

Check out the HINT section to see the metacharacters.
Path Name Metacharacters
Two most common examples.

~ (Represents the home directory)

- (Represents the previous working directory)
What characters represent the File Name Subsutition Metacharacters.
Three most common examples are:

* (Wild card multiple)
? (Wild Card single)
[] (Range of characters)
What type of Metacharacters are the ones below?

> < >>
Redirection
What are the commands to set the HOME variable to /export/home/user1 and unset the same variable
HOME=/export/home/user1

unset HOME
VAR=value
uset VAR
What three commands display all variables.
set, env, & export
What two commands display values stored in variables?
If the variable = VAR:

echo $VAR
or
print$VAR
Quoting is a process that instructs the shell to, or ignore, the special meaning of metacharacters. What are four common quoting characters?
(' ') Single forward quotation marks.
(" ") Double quotation marks.
(\) backslash
and
($ (command)) Parentheses.
As a metacharacter what dose the single backward quotation marks do ( ` )?
Single backward quotation marks instruct the shell to execute and display the output of a UNIX system command.
As a metacharacter what dose the backslash do ( \\ )?
A backslash character in front of a metacharacter prevents the shell from interpreting the next character as a metacharacter.
As a metacharacter what dose the dollar sign ( $ ) and/or parentheses do ( ( ) )?
Command Substitution

The dollar sign ($) – You can also use parentheses () to perform command substitution. Parentheses ($ (command)) instructs the shell to execute and display the output for the command enclosed within. The output of the nested command, command2, is substituted when the command1 command is executed. The syntax for this is:

command1 $(command2)
What type of metacharacters simplify location changes within the directory hierarchy.

Extra Credit: What are the metacharacters and what do the represent. Answers are in the hint section.

Check out the HINT section to see the metacharacters.
Path Name Metacharacters
Two most common examples.

~ (Represents the home directory)

- (Represents the previous working directory)
What characters represent the File Name Subsutition Metacharacters.
Three most common examples are:

* (Wild card multiple)
? (Wild Card single)
[] (Range of characters)
What type of Metacharacters are the ones below?

> < >>
Redirection
What are the commands to set the HOME variable to /export/home/user1 and unset the same variable
HOME=/export/home/user1

unset HOME
VAR=value
uset VAR
What three commands display all variables.
set, env, & export
File Descriptors determine where the input to the command originates and where the output and error messages are sent. The file descriptors are represented by the numbers 0, 1, & 2. what numbers represent:

a) Standard command input
b) Standard command output
c) Standard command error

Extra Credit what are the file description abbreviations?
0 stdin
1 stdout
2 stderr
Describe each field in the output of the ls -n command.

ls -n /var/adm/acct
total 8
drwxrwxr-x 2 4 4 1024 Oct 1 07:30 fiscal
drwxrwxr-x 2 4 4 1024 Oct 25 02:30 nite
drwxrwxr-x 2 4 4 1536 Oct 25 02:30 sum
The file/directory type
The permission sets
The number of hard links to The file or directory
The UID of the owner
The GID of the Group
The size in bytes
The time and date last modified
The name of the file or directory
Permissions:

1) Using the symbolic mode, add write permission for the group to the motd file.
2) Using the octal mode, change the permission on the motd file to –rwxrw----.
3) The file named group current permissions are 644, using the octal mode, add write permission for other on the file.
1) chmod g+w motd
2) chmod 760 motd
3) chmod 646 group
An Octal is 0 to 7
1) What command would you use to change the umask to 027?
2)What effect would that have on newly created files and directories?
1) umask 027
2) Files would be created with 640 permission sets and directories would be created with 760 permission sets.
What is the command to display the contents of ACL entries for file1?
getfacl file1
1) Create file2 and then display the ACL for that file.
2) Change the permission mode to grant read, write and execute permissions to the group that owns file2.
3) Display the ACL and a long listing for the file2 file.
4) Set the mask permissions for file2 to read only.
5) Add an ACL entry for the group named aclgroup to the file2 file and grant only read and execute permissions for this group.
1) touch file2
1) getfacl file2
2) chmod g=rwx
3) getfacl file2
3) ls –l file2
4) setfacl -m mask:r-- file2
5) setfacl –m group:aclgroup:6 file2
ACL what dose it stand for and what dose it do?

Chap 8-2
ACL = Access Control Lists
Standard UNIX file protection provides read, write, and execute permissions for the three user classes: file owner, file group, and others. ACLs provide greater data access control for each file or directory. ACLs enable you to control file permission more finely.
ACL = Access Control Lists
What is the definition for each GREP option?
a) -i
b) -l
c) -n
d) -v
e) -c
f) -w

Chap 9-2
a) Searches for both uppercase and lowercase characters.
b) Lists the names of files with matching lines.
c) Proceeds each line with the relative line number in the file.
d) Inverts the search to display lines tat do not match pattern.
e) Counts the lines contain pattern.
f) Searches for the expression as a complete word, ignoring those matches that are substrings of a larger word.
The grep command supports several regular expression metacharacters to further define a search pattern. When the metacharacters below are used in a grep command what are the results?
a) ^
b) $
c) .
d) *
e) []
f) [^]

Look at the hint to see samples.

Chap 9-5
a) '^pattern' Matches all lines beginning with pattern.
b) 'pattern$' Matches all lines ending with pattern.
c) 'p.....n' Matches lines containing a "p" followed by 5 characters and followed by an "n".
d) '[a-z]*' Matches lowercase alphanumeric characters or nothing at all.
e) '[Pp]attern' Matches lines containing Pattern or Pattern.
f) '[^a-m]attern' Matches lines that do not contain "a" through "m" and following by attern.
Regular Expression Metacharacters are used in grep commands.
a) '^pattern'
b) 'pattern$'
c) 'p.....n'
d) '[a-z]*'
e) '[Pp]attern'
f) '[^a-m]attern'
What dose the egrep command do and when the metacharacters below are used in an egrep command what are the results?
a) +
b) x|y
c)( | )

Look at the hint to see samples.

Chap 9-7
The egrep command searches the contents of one or more files for a pattern using extended regular expression metacharacters. Extended regular expression metacharacters include the regular expression metacharacters that the grep command uses plus some additional metacharacters.
a) '[a-z]+ark' Matches one or more lowercase letters followed by ark (for example, airpark, bark, dark, landmark, and shark.
b) 'apple|orange' Matches either expression.
c) '(1|2)+' or 'search(es|ing)+' Matches for one or more occurrences (for example, 1 or 2, searches or searching)
Extended Regular Expression Metacharacters are used in egrep commands.
a) '[a-z]+ark'
b) 'apple|orange'
c) '(1|2)+' or 'search(es|ing)+'
How is the fgrep command used and how are regular expressions handled?

See hint for example.

Chap 9-8
You can use the fgrep command to search a file for a literal string or a group of characters. The fgrep command reads all regular expression characters literally. Regular expression metacharacters have no special meaning to the fgrep command, for example a ? character is interpreted as a question mark and a $ character is interpreted as a dollar sign.

fgrep '*' /etc/system searches for all lines in the file containing a literal asterisk (*) character.
fgrep '*' /etc/system
1) What dose the find command do and how dose it do it?

2) Arrange the syntax of the find command in order.

a) actions
b) find
c) expressions
d) pathnames
The find command recursively descends the directory tree in the path name list, looking for the files that match the search criteria. As the find command locates the files that match those criteria, the path to each file is displayed on the screen.

bdca
or
find pathnames expressons actions

Chap 9-9
You can use the process status (ps) command to list the processes that are scheduled to run in that shell. The ps command has several options you can use to determine which processes to display and how to format the output.

Describe what the -e and -f options do for the ps command.

10-3
-e) Prints information about every process on the system, including PID, TTY, TIME, and CMD.

-f) Generates a full (verbose) listing, which adds fields including the UID, Parent Process Identification Number (PPID), and process start time (STIME).
What is the pgrep used for and what dose it display by default?

10-6
You can use the pgrep command to search for a specific process by name. By default, the pgrep command displays the PID of every process that matches the criteria you specify on the command line

The syntax is:
pgrep options pattern
What do the options below do for the pgrep command?

a) -x
b) -n
c) -U uid
d) -l
e) -t term

The syntax is:
pgrep options pattern

10-7
a) -x, Displays the PIDs that match the pattern exactly.
b) -n, Displays only the most recently created PID that contains the pattern.
c) –U uid, Displays only the PIDs that belong to the specified user. This option uses either a user name or UID.
d) –l, Displays the name of the process that are associated with a terminal in the term list.
e) –t term, Displays only those processes that are associated with a terminal in the term list.
These are just hints not answers!

a) -x, eXact
b) -n, Pattern Name
c) -U, User
d) -l, List process & PID
e) -t, Terminal
What dose the ptree command do?



10-9
The ptree command displays a process based on the process ID that was passed as an argument to the command. The output has the specified PIDs or users, with child processes indented from their respected parent process. An argument of all digits is taken to be a PID, otherwise it is assumed to be a user login name.
The ps command is an example for the ptree command.
For best viewing set options to Courier New:

A signal is a message you can send to a process. Process respond to signals by performing the action that the signal requests. Signals are identified by a signal number, signal name, and the corresponding event that results. Fill in the blanks and provide a definition for each signal.

...Signal..Signal..Event
...Number..Name
a) 1.......?........?
b) ?.......SIGINT...?
c) ?.......?........Kill
d) 15......?........?


10-10
Notes in hint.
a) 1, SIGHUP, Hang up: A hung-up signal that drops a telephone line or terminal connection. This signal also causes some programs to re-initialize themselves without termination.
b) 2, SIGINT, Interrupt: An interrupt signal you generate from your keyboard, usually using Control-C.
c) 9, SIGKILL, Kill: A signal that kills a process. A process cannot ignore this signal.
d) 15, SIGTERM, Terminate: A Signal that terminates a process in an orderly manner. Some processes ignore this signal. This is the default signal that kill and pkill send.
Note - Refer to the -s3head signal man page to vies a complete list of signals and their default actions. You can perform the kill –l command to display the signal name associated with a particular signal number.
Job Control commands:

What do the jobs control commands below do?

a) jobs
b) bg %n
c) fg %n
d) Control-Z
e) stop %n

See hint for Note:
11-3
a) Lists all jobs that are currently running or are stopped in the background.
b) Runs the current or specified job in the background (n is the job ID).
c) Brings the current or specified job into the foreground (n is the job ID).
d) Stops the foreground job and places it in the background as a stopped job.
e) Stops the job that is running in the background (n is the job ID)
Note - You can control a job by using these commands only in the shell which the job started.
a) Describe a korn shell function
b) Specify a korn shell function command line format.
Korn shell functions are a powerful feature of shell programming used to construct customized commands. A function is a group of UNIX commands organized as a separate routines. Using functions involves two steps:
1) Define the function.
2) Invoke the function.

Defining a Function:
A function is defined using the general format:
Function_name { command;…command; }

Note: a space must appear after the first brace and before the closing brace.

Example:
$ function num { who | wc-l; }
$ num
9
a) What command would you use to display a list of all functions?
b) What command would you use to display just the function names?

Example of a function:
The following example creates a function called num to perform the who command, directing the output to the wc command to display the total number of users currently logged on the system:

$ function num { who | wc l; }
$ num
9
a) typset -f
b) typset +f
In the Korn shell tar and gzip the files file1, file2, & file3 to a file called files.tar on non tape drive (current directory) in verbose mode.
In bash this can be done in one line, but in korn you must use two.
1) tar cnvf files.tar file1 file2 file3
2) gzip files.tar
In the korn shell you need to do this on 2 seperate lines.
What dose the command volcheck do and what is it’s syntax?
Before you can create a file archive on a diskette, insert a disk into the drive and run volcheck. This command informs the Volume Management program to check for media in the drive.

The Volume manager program provides automatic detection of removable media. However, because of hardware limitations in many floppy drives, the Volume Management program dose not detect the presence of a newly-inserted diskette.

The volcheck command checks for all removable media managed by the Volume Management program. The volcheck command checks for all diskettes by default.

Man Page description:
The volcheck utility tells Volume Management to look at each dev/pathname in sequence and determine if new media has been inserted in the drive.

The syntax for the volcheck command is:
volcheck –v device_pathname
.rhosts

a) Where is the .rhosts file located?

b) What will happen if a plus sign (+) is located in the .rhosts file?


Chap 15-4
a) .rhosts is located in a users home directory, i.e. ~/.rhosts.

b) If the users .rhosts file contains a plus (+) character, then the user is able to log in from any know system on the network without supplying a password.
rsh

a) What dose the rsh command do?

b) What is its syntax?
a) You can use the rsh command to run a program on a remote system without haveing to log in to the remote system.

b) The syntax for the rsh command is:
rsh hostname command
Syntax jumble

hostname
command
rsh
rcp

a) What dose the rcp command do?

b) What is its syntax?
a) You can use the rcp command to copy files or directories from one host to another. To copy subdirectories and their contents use the rcp –r command. The rcp command checks the .rhosts file to determine if you have necessary access permissions.

b) The syntax for the rcp command is:

Copying files:
rcp source_file hostname:destination_file
rcp hostname:source_file destination_file
rcp hostname:source_file hostname:destination_file

The source_file is your original file and the destination_file is the copy of the original.

Copying directories:
rcp –r source_dir hostname:destination_dir
The kernel, which manages all the physical resources of the computer, including:
* File systems and structures
* Device management, such as storing data to the hard disk
* Process management or CPU functions
* Memory management
4 functions of the kernal. What it manages, not OS or app.
The Solaris OS supports three primary shells, What are they?
* Bourne shell (Prompt $ and #)
* C shell (Prompt hostname% and X)
* Korn shell (Prompt $ and #)
Alternative Shells
The Solaris 10 OS contains three additional (alternative) shells:
tsch
Z
bash (Baurn again shell)
In the Solaris OS, a user’s password must have the following characteristics:
* Be six to eight characters in length
* Contain at least two alphabetic characters and must contain at least one numeric or special character, such as a semicolon (;), an asterisk (*), or a dollar sign ($)
* Differ from the user’s login name
* Differ from the previous password by at least three characters
* Contain spaces (optional)
* Not be the reverse of the user’s login name

These password requirements do not apply to the system administrator’s root account password or to any password that is created for a regular user by the root user.
Securing Your Desktop Environment Session

Securing your desktop environment session prevents unauthorized users from gaining access to the system. There are two ways to secure the system:, what are they?
* Locking the screen
* Exiting the session
Padlock and EXIT buttons on the front panel

Padlock icon locks the screen
Describe the:

Current Session
&
Home Session
The running session is always considered the current session. When you exit a session, the system saves the current session by default. The next time you log in to the desktop, the system displays this current session exactly as it appeared when you last logged out. This function can be modified using the Style Manager – Startup utility. This Style Manager can be accessed by clicking the Desktop Controls icon located on the front panel.

You can also create a session in the same state every time you log in, regardless of the state of the session when the previous user logged out. You save the state of a current session using the Style Manager – Startup settings. This sets the current session as your default session for every time you log in.
Describe relative and absolute path names.
When you specify the location of a file or directory starting with a slash (/) or the root (/) directory, it is an absolute path name. When you specify the location of a file or directory starting with its parent directory, it is a relative path name.
Distinguish between the SunOS 5.x operating system and the Solaris 10 OS.
The SunOS 5.x operating system consists of the kernel, the shell, and the directory hierarchy.

The Solaris 10 OS consists of the SunOS 5.x operating system, Open Network Computing (ONC+) software, and the Solaris desktop environment GUI.
Name the default shell for the root (/) user in the Solaris 10 OS.
Bourne shell.
Not again.
What are the two ways in which you can secure your login session?
Locking the screen and exiting the session.
Desktop login session
Describe the output below for the uname command.

uname -i
uname -s -r
uname -rs
uname -a
The -i option shows the name of the hardware platform.

The -n option prints the host name of the local system.

The -s option shows the name of the operating system.

The -r option shows the operating system release level.

The uname command with two combined options - same results as if they were seperated.

The uname command with the -a option shows information currently available from the system
$ uname -i
SUNW,Ultra-5_10

$ uname -n
host1

$ uname -s -r
SunOS 5.10

$ uname -rs
SunOS 5.10

$ uname -a
SunOS host1 5.10 Generic sun4u sparc SUNW,Ultra-5_10
What is the output of this command. Describe the command, option and argument portions of:

cal 12 2004
The following example shows the cal command with two
arguments. The first argument, 12, specifies the month to be viewed. The second argument, 2004, specifies the year to be viewed.
Enter the command to display information about the operating system and the workstation name.
$ uname -a
Enter the uname -s command. What information appears?
The operating system name, for example, SunOS.
Enter the uname -r command. What information appears?
The operating system release level, for example, 5.10.
What special character separates commands on a single command
line?
The semicolon (;).
Specia Character to enter two commands on one line.
Describe the keys to control scrolling in Man Pages:

Space bar
Return
b
/pattern
h
q
Space bar Displays the next screen of a man page

Return Displays the next line of a man page

b Moves back one full screen

/pattern Searches forward for a pattern

n Finds the next occurrence of a pattern after you have used /pattern

h Provides a description of all scrolling capabilities

q Quits the man command
The last section of a man page, titled SEE ALSO, lists other commands or files related to the man page. The number in parentheses reflects the section where the man page is located. You can use the man command with the -l option to list the man pages that relate to the same command or file name.
The following example shows the SEE ALSO part of the man page for passwd(1). Note that there is also a man page entry for passwd in Section 4.

SEE ALSO
finger(1), login(1), nispasswd(1), nistbladm(1), yppasswd(1), domainname(1M), eeprom(1M), id(1M), passmgmt(1M), pwconv(1M), su(1M), useradd(1M), userdel(1M), usermod(1M), crypt(3C), getpwnam(3C), getspnam(3C), getusershell(3C), nis_local_directory(3N), pam(3), loginlog(4), nsswitch.conf(4), pam.conf( 4), passwd(4), shadow(4), attributes(5), environ(5), pam_unix(5) ... (output truncated)
What dose man -l passwd and man -s 4 passwd have in common.
man -l lists all manual pages found matching passwd.
For example:
sj1454@tsprepo1 (/export/home/sj1454): man -l passwd
passwd (1) -M /usr/share/man
passwd (4) -M /usr/share/man

And man -s 4 passwd specifies a section (found with the -l option above) to search.
For example:

sj1454@tsprepo1 (/export/home/sj1454): man -s 4 passwd
Reformatting page. Please Wait... done

File Formats passwd(4)

NAME
passwd - password file

SYNOPSIS
/etc/passwd ~
When you are not sure of the name of a command, you can search for man page entries that are related by using the man command with...?
The -k option and a keyword. The man command output provides a list of commands and descriptions that contain the keyword. The syntax for using the command to conduct a keyword search is:

man -k keyword
What Web site enables you to browse Sun product documentation?
The Web site http://docs.sun.com.
Describe basic terms: Directory
A directory is a list of references to objects, which can include files, sub directories, and symbolic links. Each reference consists of two components: a name and a number. The name of the object is used to identify and access the object. The number specifies the inode in which information about the object is stored.
Describe basic terms: Inode
An inode is a list of information relating to a particular object (for example, file, directory, or symbolic link). The information held by the inode includes the type of object about which the inode holds information, permissions, ownership information, and the locations in which data is stored.
What information is displayed by the ls -l command.
* File type (example: - for regular file or d for directory)
* Permissions
* Link count
* Owner
* Group
* Size
* Last modification date and time
* File name
What dose this command do:

ls -ld dir1
You can use the ls -ld command to view detailed information about a directory without viewing its contents.

$ ls -ld dir1
drwxr-xr-x 5 user1 staff 512 Feb 22 14:51 dir1
What dose this command do:

ls -R dir1
You can use the ls -R command to display the contents of a directory and the contents of all of the directory’s subdirectories. This type of list is known as a recursive list. To view a recursive list of the contents of the dir1 directory, perform the
ls -R dir1 command.

$ ls -R dir1
dir1:
coffees fruit trees

dir1/coffees:
beans brands nuts

dir1/coffees/beans:
beans

dir1/fruit:

dir1/trees:
You want to enter several commands on a single command line.

Which character is used to separate these commands?

/
|
;
:
;

You can enter multiple commands on a single command line by using a semicolon (;) to separate each command. The shell recognizes the semicolon as a command separator.
not |
Which command would display the man pages found matching the name within the search path?

man -d name
man -M name
man -s name
man -l name
man -l name

Lists all manual pages found matching "name" within the search path.
Not -s
Which command would search the man pages using a keyword?

man -d keyword
man -k keyword
man -s keyword
man -l keyword
man -k keyword ...

Prints out one-line summaries from the win-dex database (table of contents) that contain any of the given keyword(s).
not -d
You want a long listing of the contents of a directory sorted by timestamp.

Which command would generate this output?

ls -lt dir1
ls -ls dir1
ls -lu dir1
ls -al dir1
ls -lt dir1

Sorts by time stamp (latest first) instead of by name. The default is the last modification time.
not u
You are required to view a large text file.

Which command would allow you to view a large text file one screen at a time?

view filename
cat filename
more filenamedir1
disp filename
The more utility is a filter that displays the contents of a text file on the terminal, one screenful at a time.
not disp filename
Which command would display from line number 32 in file1 to the end of the file?
tail -32 file1
from +32 file1
view -32 file1
tail +32 file1
tail +32 file1

+ Copying starts relative to the beginning of the file.
Which command would prompt you before deleting a file?

rm -a file1
rm -f file1
rm -i file1
rm -c file1
rm -i file1

Interactive. With this option, rm prompts for confirmation before removing any files.
Given:
$ ls -ld dir2
drwxr-xr-x 2 user2 other 512 Sep 8 15:30 dir2
$ cp file1 ../dir2
is executed.

Which is a TRUE statement about the result of this command?

1) file1 will be copied into dir2, and overwrite file1 if it exists.

2) The command will fail as you have not supplied a filename in the second argument.

3) file1 will not be copied into dir2 if a file called file1 exists.

4) The command will fail, you cannot use relative pathnames with the copy command.
1) file1 will be copied into dir2, and overwrite file1 if it exists.
Given:

$ ls -li *

11 -rw-r--r-- 2 user1 other 9 Sep 8 15:10 file1
12 -rw-r--r-- 1 user1 other 15 Sep 8 15:09 file2
11 -rw-r--r-- 2 user1 other 9 Sep 8 15:10 file3
14 -rw-r--r-- 1 user1 other 15 Sep 8 15:13 file4 -> file2

Which is a TRUE statement about this command on a default system?

1) file1 and file3 are hard linked.
2) file2 and file4 have a size 1 byte each.
3) file1 and file3 have a size of 2 bytes each.
4) file2 is a symbolic link to file4.
file1 and file3 are hard linked.

The key is that the -i in ls -li prints the i-node number in the first column of the report. File 1 and 3 have the same i-node number.
NO HINT FOR YOU!
You were editing a file using vi when the system crashed.

When the system is back up which command should recover the file?

vi -R filename
vi -u filename
vi -i filename
vi -r filename
vi -r filename

Edits filename after an editor or system crash. (Recovers the version of filename that was in the buffer when the crash occurred.)
Not -u
Which command in vi repeats the previous command?

1) r
2) .
3) :
4) @
. (dot) Repeats the previous command
not r
You want to replace the first instance of the word hello with goodbye on every line.

Which command will achieve this?
:%s/hello/goodbye/g
:%s/hello/goodbye/1
:%s/hello/goodbye/
:%s/hello/goodbye/c
:%s/hello/goodbye/g

:%s/old/new/g

Searches for the old string and replaces it with the new string globally.
Not :%s/hello/goodbye/1
Given:

$ id -a
uid=123(user1) gid=104(sales)
$ echo $SHELL
/bin/ksh

Which command would change your current working directory to the home directory of user2?

cd $HOME:user2
cd ~user2
cd $USER2
cd @user2
cd ~user2

$ cd ~user1
$ pwd
/export/home/user1

You can also use the tilde (~) to represent your home directory in a relative path. The tilde (~) in the following example represents the user1 home directory.

user2@system1 (/export/home/user2/dir2): cd ~user2

user2@system1 (/export/home/user2):
Given:

ls -l [a-g]*

How will the pattern [a-g]* be evaluated?

1) Only the file names not starting with a through to g will be displayed.
2) Only the file names not starting with an a or a g will be displayed.
3) Only the file names starting with a through to g will be displayed.
4) Only the file names starting with a or g will be displayed.
3) Only the file names starting with a through to g will be displayed.

A range of characters is a series of ordered characters. A range lists the first character, a hyphen (-), and the last character, for example, [a–z] or [0–9]. When you specify a range, arrange the characters in the order that you want them to appear in the output. Use [A–Z] or [a–z] to search for any uppercase or lowercase alphabetical character, respectively.
Not (1)
Given:

head -15 file1 | tail -5 | lp

What content from file1 will be printed out?

1) The last 5 lines of file1.
2) The command will fail as there is no argument to the lp command.
3) From line 5 of file1.
4) Line numbers 11 thru 15 of file1.
(4) Line numbers 11 thru 15 of file1.

user1@system1 (/export/home/user1): head -15 file1 | tail -5
11
12
13
14
15
Not (1)
Which command will display the file permissions?

1) ls -p
2) view perms
3) dir -l
4) ls -l
4) ls -l
It has been decided that all new files that are created are to have their permissions set to -rw-rw-r--.

Which command added to the appropriate initialisation file will achieve this?

umask 664
umask 003
umask 663
umask 004
umask 003

To determine the umask value you want to set, remove the value of the permissions you want from 666 (for a file) or 777 (for a directory). The
remainder is the value to use with the umask command.

File and Directory Permissions for umask Values umask Octal Value, File & Directory Permissions
0 rw- rwx
1 rw- rw-
2 r-- r-x
3 r-- r--
4 -w- -wx
5 -w- -w-
6 --- --x
7 --- --- (none)
Given:

$ ls -ld dir1
drwxr-xrwx 2 root sys 512 Sep 10 16:21 dir1

$ ls -l dir1
-r-xr----- 2 root sys 512 Sep 10 16:21 file1
-r-xr--r-- 2 root sys 512 Sep 10 16:21 file2
-r-xr-xr-x 2 root sys 512 Sep 10 16:21 file3
-r-------- 2 root sys 512 Sep 10 16:21 file4

Who can delete files in the dir1 directory?

1) Only the owner of files can delete them.
2) The owner of the file and any user in the sys group, provided the group owner has the w permission set on the file.
3) The owner of the file and any other user not in the sys group.
4) Nobody as the w permission bit is not set on any of the files.
The owner of the file and any other user not in the sys group.

It's the directorys permission that lets you delete a file.

Access for a Directory

r = You can list the directory contents with the ls command.

w = You can modify the contents of a directory, such as deleting a file. You must also have the execute permission for this to happen.

x = You can use the cd command to access the directory. If you also have read access, you can run the ls -l command on the directory to list contents. If you do not have read access you can run the ls command as long as you know the file name.
File permissions:

r = You can display file contents and copy the file.

w = You can modify the file contents.

x = You can execute the file if it is an executable. You can execute a shell script if you also have read and execute permissions.
You need to give access to a file to a user that is not in your group. You do not want to change the file permissions, as this would give everybody access. The system administrator is not going to make this user a member of the group that owns the file.

Which facility in Solaris allows you to give specific access to this user?
1) You would set an ACL on the file.
2) By default this type of permission granularity is not available for Solaris.
3) The chown -s command allows you to set special permissions.
4) Only the superuser can set special permissions on any files.
You would set an ACL on the file.

An ACL is used by the owner of a file or directory to grant or deny specific user access, by using the three user classes of user, group, and other.
permission granularity IS available for Solaris.
Which command command displays the ACL of a file?

1) viewacl filename
2) getfacl filename
3) dispacl filename
4) listacl filename
getfacl filename(s) Displays ACL entries for files
Not listacl filename
The user user3 needs to have read and write access to the project file in your home directory.

Which command would give user3 the required access to the file?

1) setfacl -u=user3 -p=rw- -m=rw- project
2) setfacl p=rw-:user3:m=rw- project
3) setfacl u:user3,p=rw-,m=rw- project
4) setfacl -m u:user3:rw-,m:rw- project
setfacl -m u:user3:rw-,m:rw- project

The syntax of the command is:
setfacl -m acl_entry filename.

u[ser]:username:perm = The permissions for a specific user. The username must exist in the /etc/passwd file.

m[ask]:perm = The ACL mask indicates the maximum effective permissions allowed for all specified users and groups. The mask does not set the permissions for the owner or others. You can use the mask as a quick way to change effective permissions for all the specific users and groups.
not setfacl -u=user3 -p=rw- -m=rw- project
Which command would display with line numbers all the lines that match the pattern root from the /etc/passwd file?

1) grep -n root /etc/passwd
2) grep -p root /etc/passwd
3) grep -v root /etc/passwd
4) grep -l root /etc/passwd
grep -n root /etc/passwd

-n Precedes each line by its line number in the file (first line is 1).
Not grep -p root /etc/passwd
You need to locate all the files in the /export/projects directory named test and automatically delete them.

Which command would delete these files?

1) find /export/projects -file test -exec rm -f {} \;
2) find /export/projects -name test -ok rm {} \;
3) find /export/projects -f test -ok rm -f {} \;
4) find /export/projects -name test -exec rm -f {} \;
4) find /export/projects -name test -exec rm -f {} \;


$ find /export/projects -name test -exec rm -f {} \;
$ (Automatically deleted the file)

find /export/projects -file test -exec rm -f {} \;
find: bad option -file
find: [-H | -L] path-list predicate-list

find /export/projects -f test -ok rm -f {} \;
find: bad option -f

$ find /export/projects -name test -ok rm {} \;
< rm ... /export/projects/test >? n (This one asks for confermation before it delets the file - not automatic).
find /export/projects -f test -ok rm -f {} \;
find: bad option -f
. Which command will display all the processes currently running on your system?

1) ps -ef
2) ps
3) proc -a
4) pid -a
ps -ef

You can use the ps -ef command to view a listing of all the processes currently scheduled to run on the system. The following example shows how you can use the ps -ef command to display a listing of all processes.
$ proc -a
ksh: proc: not found
Which command would kill a process in an orderly manner?
1) kill -9 PID
2) pkill -TERM PID
3) pkill -KILL PID
4) kill -15 PID
4) kill -15 PID

Syntax: kill [-signal] PIDs

- 15 = A signal that terminates a process in an orderly manner. Some processes ignore this signal. This is the default signal that kill and pkill send.

-9 = A signal that kills a process. A process cannot ignore this signal.
pkill [-options] pattern
Which command would display the process name and arguments used to start a process?

1) ps -a process name
2) pgrep -fl process name
3) pview -s process name
4) proc -s PID
pgrep -fl process name

The following example shows how to use the pgrep command with the -fl options to display:

$ pgrep -l mountd
155 automountd

$ pgrep -fl automountd
155 /usr/lib/autofs/automound

-l option to display the PID and name.
-f to display the full path of the name.
not proc -s PID
You want to customize the df command, so that it always executes with the -h option.

Which Korn shell utility would you use to customize this command?

1) alias
2) modcom
3) cust
4) modify
1) alias
You have commenced several jobs in the Korn shell, and wish to check if a particular job is still running.

Which command would bring this job from the background to the foreground?

1) jobs -fg %job_id
2) fg %job_id
3) for %job_id
4) PID -f job_id
2) fg %job_id
You are using the Korn shell and want to prevent accidentally overwriting any files when you use redirection.

Which Korn shell option can you set to avoid this problem?

1) set -o nooverwrite
2) set -o nosave
3) set -o nochange
4) set -o noclobber
4) set -o noclobber
You need to write a script that will always execute in the Korn shell.

Which line in the script would ensure that the script was executed in the Korn shell?

1) $!/bin/ksh
2) @!/bin/ksh
3) #!/bin/ksh
4) %!/bin/ksh
#!/bin/ksh
You have created a script called myvars and want to execute the script without spawning a subshell.
Which command would execute this script without spawning a subshell?

1) myvars
2) ./myvars
3) /myvars
4) . myvars
4) . myvars

The dot (.) command performs the commands in the specified script in the current shell, as if the commands were entered on the command line.

$ . myvars running myvars
not 1) myvars
How would you display the exit status of the last command?

1) echo $0
2) echo $?
3) echo $&
4) echo $1
2) echo $?

The program developer can use the exit status values to indicate different error situations. The exit status of the last command performed in the foreground is held in the $? special shell variable, and can be tested by using the echo command.
Not 4) echo $1
Your system has the volume management service enabled and is online.

Which command would automatically mount a floppy disk?

1) volcheck
2) fdisk
3) format
4) rmdisk
1) volcheck

The volcheck command checks for all removable media managed by the Volume Management program. The volcheck command checks for all diskettes as a default. It instructs the Volume Management program to check each device path name in sequence and determine if a new diskette is in the diskette drive.
Not 3) format
You want to create a tape archive that is compressed in single command.

Which command would produce a compressed tape archive?

1) tar
2) cpio
3) jar
4) car
3) jar

The jar command has syntax similar to the tar command, but the jar command compresses the named files in addition to archiving the files. The jar command copies and compresses multiple files into a single archive file.
Not 2) cpio
Given:
pwd
/export/home/user1

Which command would create an archive of your home directory to the tape device?

1) tar cv /dev/rmt/0 .
2) tar xvf /export/home/user1 /dev/rmt/0
3) tar cv .
4) tar tvf /dev/rmt/0 .
1) tar cv /dev/rmt/0 .

Archive your home directory on a tape.
$ cd
$ tar cvf /dev/rmt/0 .
Not 4) tar tvf /dev/rmt/0 .
You execute the command compress file4 which replaces the original file with a new one.

What is the name of the new file?

1) file4.S
2) file4.C
3) file4.R
4) file4.Z
4) file4.Z
Not 3) file4.R
You have been sent a file called project.gz

Which command will unpack this archive?

1) gunzip project.gz
2) unzip project.gz
3) gzip -u project.gz
4) extract -z project.gz
1) gunzip project.gz

You can use the gunzip command to restore a file that has been compressed with the gzip command.

The following example shows you how to uncompress the file1.gz file.

$ gunzip file1.gz
not 3) gzip -u project.gz
Which command allows you to view compressed files with out uncompressing them?

1) zcat
2) ccat
3) view -c
4) disp -C
1) zcat

The three commands can you use to view the contents of a file that was compressed with the compress command?
The uncompress -c filename command, the zcat filename
command, or the gzcat filename command.
not 4) disp -C
You have remotely logged on to another system without the need to provide a password.

Which file on the remote system allows a user to by-pass password authentication?
$HOME/.secure
$HOME/.allow
$HOME/.trusted
$HOME/.rhosts
$HOME/.rhosts

If the user’s .rhosts file contains a plus (+) character, then the user is able to log in from any known system on the network without supplying a password.
Not $HOME/.trusted
Which command would allow you to run a program on a remote system?

1) rproc
2) rsh
3) rksh
4) rcom
2) rsh

You use the rsh command to run a program on a remote system without having to log in to the remote system.
Not 4) rcom
Which sub command, when using FTP, allows you locally change your currrent directory?

1) cd
2) chdir
3) rcd
4) lcd
4) lcd


You can use the lcd command at the ftp> prompt to change the current working directory on your local system.
Not 2) chdir
23. Which command would match all the lines that do not match the pattern user1 in the /etc/passwd file?

grep -n user1 /etc/passwd
grep -p user1 /etc/passwd
grep -v user1 /etc/passwd
grep -l user1 /etc/passwd
grep -v user1 /etc/passwd
Describe:

ls -ld
ls -R
ls -F
ls -ld: To obtain detailed directory information for the dir1 directory, perform
the ls -ld command.
$ ls -ld dir1
drwxr-xr-x 5 user1 staff 512 Feb 22 14:51 dir1

ls -R: To view a recursive list of the contents of the dir1 directory, perform the
ls -R dir1 command.

ls -F:You can use either the ls -F command or the file command to display
file types.
Symbol - File Type
/ - Directory
* - Executable
(None) - Plain text file
@ - Symbolic link
The syntax for the cp command when copying files is:

What do the options -i and -r do in the copy command?
cp -option(s) source(s) target

The source option is a file. The target option can be a file or a directory.

-i Prevents you from accidentally overwriting existing
files or directories
-r Includes the contents of a directory, including the contents of all subdirectories, when you copy a directory
mkdir -p directory_names

What dose the -p option do?
The command used with the -p option creates all of the non-existing parent directories that do not yet exist in the path to the new directory.
mkdir -p directory_name(s)
What dose the ln -s command co?

What is it's syntax?
You can use the ln -s command to create a symbolic link file. You can
use either relative or absolute path names to create a symbolic link file. The file name for the symbolic link appears in the directory in which it was created.

The syntax for the ln -s

command is:
ln -s source_file target_file

The source_file variable refers to the file to which you create the link. The target_file variable refers to the name of the symbolic link. When creating a symbolic link, the source_file might not already exist. If the source_file does not exist, a symbolic link that points to a non-existing file is created.
Recursively list the contents of the practice1 directory.
$ ls -R practice1
Assume you don't need to enter a path.
In your home directory, create a directory called house with a
subdirectory of furniture using a single command.
mkdir -p house/furniture
Using one command, create three directories called records, memos, and misc in your home directory.
$ mkdir records memos misc
Create a file named mycontents that is a symbolic link to the file
/var/sadm/install/contents.
ln -s /var/sadm/install/contents mycontents
Using a single command, copy the play directory in the practice1 directory to a new directory in the practice1 directory called appointments.
cp -r practice1/play practice1/appointments
not mkdir
In your home directory, create a directory called house with a
subdirectory of furniture using a single command.
cd; mkdir -p house/furniture
Identify the command to remove a directory that is not empty. Remove the house/furniture directory. List the contents of the house directory to verify that the furniture directory has been removed.
$ rm -r house/furniture
$ ls house
$
r
Create a file named mycontents that is a symbolic link to the file /var/sadm/install/contents.

Verify that the symbolic link works.
$ ln -s /var/sadm/install/contents mycontents

$ more mycontents