Professional Documents
Culture Documents
UNIX backups/Restore
Commands to take backup of /usr /var /lib directories to tape and disk using "tar"
ANS: a) tar -cvf /dev/rmt/0 /usr /var /lib [Taking into tape ]
ANS: a) tar -cv /var /usr /lib | rsh remote_hostname dd of=/dev/rm/0 obs=128
Network
What is the pocket size used by SQL*NET Version 2 on Solaris
Ans : Default is 2K
What is the procket size used by network layer TCP/IP in SQL*NET v2?
Ans : Default 1K
The post wait driver reduces the overhead incurred by the more expensive use of semaphore operation for interprocess
communication.
Memory
What is the kernel parameter which controls the UNIX buffer cache on solaris ?
Ans : bufhwm ( bufhwm is the maximum amount of physical memory, in kilobytes that can be used by
I/O buffers)
While starting an oracle process , the unix system displays an erro message like "Cannot allocate more shared memory
segment for the processes" If oracle person approaches you, how will you fix this problem?
ANS: increase the value for kernel memory parameter "set semsys:seminfo_semmns" in /etc/system file. [ this is a blind way]
System configurations
How do you find no. of processors installed on your sun box and processing speed?
Ans: $psrinfo –v
How do you find out how many disks are available on your system?
$ iostat –E (for users – count only the disks which has disk size correctly)
What is the meaning of logical name of a disk drive format like c0t0d0s0?
d0 - Disk number
ANS: prtconf
Sysdef
Dmesg
sysinfo
Thoughtful Solutions
Creatively Implemented and Communicated
http://www.thoughtful-solutions.info/
Basic Solaris Commands
Quick Reference Card
Conventions
<CR> RETURN key
<ESC> ESCAPE key
<DEL> DELETE key
<Ctrl-X> press <Control> key and type x
italics items to be replaced by your own
requirements
Shell Commands
passwd Change password
logout End terminal session
File Hierarchy
cd dir1 Change to directory dir1
ls List files in directory
ls -l List files in detail
mkdir dir1 Create new directory dir1
rmdir dir1 Remove directory dir1
cp f1 f2 Copy file f1 to f2
mv f1 [f2…] dir1 Move files f1 to fn to directory
dir1
mv dir1 dir2 Rename directory dir1 as dir2
rm filename Delete (remove) file filename
ln file1 name Create a hard link to file1 called
name
ln -s file1 name Create a soft link to file1 called
name
pwd Show path to current directory
Getting Help
man name Show man page for command
name
man -k subject Show man pages relating to
subject
man -s# subject Show man page relating to
subject in section number #
man -s# Intro Show introductory man page for
section #
File types and Listing
file filename Classify the file
strings filename Show any ASCII strings in a file
cat filename Display contents of file to STDOUT
more filename Display contents of file one
screenful at a time
head filename Display first 10 lines of file
head -n filename Display first n lines of file
tail filename Display last 10 lines of file
tail -n filename Display last n lines of file
tail -f filename Recursively display last 10 lines of
file
cut Extract character or fields from
text
wc filename Count lines, words and characters
in file
diff f1 f2 Find differences between two files
diff3 f1 f2 f3 Find differences between 3 files
sort filename Sort file alphabetically by first
letter
uniq Report or filter out repeated lines
Redirection
STDIN Standard Input, typically the
keyboard
STDOUT Standard Output, typically the
screen
STDERR Standard Error, where errors are
sent. Typically the screen
comm > file Output of comm creates file
comm < file Contents of file used as input to
comm
comm 2> filename Error messages from comm sent to
file
comm >> filename Output from comm appended to
file
cat file <<EOF Create a document called file
data… containing data
EOF
comm1 | comm2 Output from comm1 used as input
to comm2
mkfifo name Create a named pipe called name
mknod name p Create a named pipe called name
File Security
chmod mode filename
Change security settings on file
chown user [:group] filename
Change owner [and owning group] of
file
chgrp group filename
Change owning group of file
umask mode Set default creation permissions
Symbolic modes
Mode Meaning Mode Meaning
u user r read
g group w write
o other x execute
a all u+s setuid
= assign g+s setgid
+ add +t sticky bit
- remove
Octal modes
Base directory mode is 777. Base file mode is 666
user group other
rwxrwxrwx
421421421
777
Shell Wildcards
Metacharacter
Meaning
* Any character
? Any single character
[ ] A range of characters
This work is licensed under the Creative Commons Attribution-
ShareAlike License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/2.0
View Answer
What is the big difference between /dev/dsk and /dev/rdsk
What are the main differences between solaris 10 and 9? View Answer
What would a XIR signal do to a server and why would it be used? View Answer
What is the big difference between /dev/dsk and /dev/rdsk View Answer
What software install group do you need to select in order to load the
View Answer
compilers?
Which NFS daemons are found on the NFS server? View Answer
The NVRAM is also soldered to the main logic board or motherboard. View Answer
When using the admintool, the membership list for groups is separated by
View Answer
what?
How would you find out what kernel parameter SHMMAX is set to by one
View Answer
command?
I have a couple of questions. 1) If in solaris 8 one server has more than one
network interface cards, how do you determine which is primary? 2)In solaris
View Answer
8 how do you determine how many Ram cards exist in a server and in which
slots are they inserted?
How do you determin which Run Level the sytem is running View Answer
What is "Piping"? View Answer
Contact Vincent
Single User mode: Single user mode is for trouble shooting purpose, in this mode only root user can
login to the system.
Multi User Mode: In this mode apart from root user other user can also login to the system and they
can access resources and applications of the system.
Contact Basha
Single user
Solaris OS single-user mode with critical file systems mounted and accessible, Maintenance
Only root user can access.
Multi user
The system is supporting multiuser operations. Multiple users can access the system. All system
daemons are running except for the Network File System (NFS) server and some other network
resource server related daemons.
In multiuser mode NFS server & client services are available whereas in single user mode, no NFS
service is available and only root filesystem is available.
Contact G.Umakanth
In single user mode , all the system services will not be available such as NFS and other
services,moreover only a single user can login at a time, where as in multiuser mode all the services
will be available including NFS and multiple users can log in at a time. In single user mode the run
level is S where as in multiuser mode the runlevel is 3
In single user mode it is possible to maintin the system or trouble shooting the system.
Contact sv suresh
single user mode is an administrative mode . the root user only can login. it is also known as
maintenance mode. multiuser mode is default mode in solaris bcoz all services available in this
mode. from singleusermode we cannot communicate network machines.but from multiusermode we
communicate over the network.
Contact premnivas
In single user, critical file system will be mounted and where as multi user mode we can access nfs
and it is default run level.
In single user mode we can perform administrative tasks and it is maintenance mode. Multi user
mode runs the server with full network and services including nfs
Contact fazal
Contact wadood
Single user mode use to perform the administrative task,we can only access the local file system,
Multi usermod is the defult login mode so we can access all local as well as network file file system,
single user mode: In this only root user can login to the system and critical file systems are
mounted. This can be used for trouble shooting purpose.IN this NFS not working.
Multi user mode: This is run level 3. In apart from root user other users also login and access the file
systems including NFS.
3. Delete blank lines in a file ? - cat sample.txt | grep -v ‘^$’ > new_sample.txt
4. Search for a sample string in particular files ? - grep “Debug†*.confHere grep uses the
string “Debug†to search in all files with extension“.conf†under current
directory.
5. Display the last newly appending lines of a file during appendingdata to the same file by some
processes ? - tail –f Debug.logHere tail shows the newly appended data into Debug.log by some
processes/user.
6. Display the Disk Usage of file sizes under each directory in currentDirectory ? - du -k * | sort Ã
¢â‚¬â€œnr (or) du –k . | sort -nr
7. Change to a directory, which is having very long name ? - cd CDMA_3X_GEN*Here original
directory name is – “CDMA_3X_GENERATION_DATA†.
8. Display the all files recursively with path under current directory ? - find . -depth -print
9. Set the Display automatically for the current new user ? - export DISPLAY=`eval ‘who am i | cut
-d"(" -f2 | cut -d")" -f1′`Here in above command, see single quote, double quote, grave ascent is used.
Observe carefully.
10.Display the processes, which are running under yourusername ? - ps –aef | grep
MaheshvjHere, Maheshvj is the username.
11. List some Hot Keys for bash shell ? - Ctrl+l – Clears the Screen. Ctrl+r – Does a
search in previously given commands in shell. Ctrl+u - Clears the typing before the hotkey. Ctrl+a Ã
¢â‚¬â€œ Places cursor at the beginning of the command at shell. Ctrl+e – Places cursor at the
end of the command at shell. Ctrl+d – Kills the shell. Ctrl+z – Places the currently
running process into background.
12. Display the files in the directory by file size ? - ls –ltr | sort –nr –k 5
13. How to save man pages to a file ? - man <command> | col –b > <output-file>Example : man
top | col –b > top_help.txt
14. How to know the date & time for – when script is executed ? - Add the following script
line in shell script.eval echo "Script is executed at `date`" >> timeinfo.infHere, “timeinfo.infÃ
¢â‚¬Â contains date & time details ie., when script is executed and history related to execution.
17. Display top ten largest files/directories ? - du -sk * | sort -nr | head
18. How much space is used for users in kilobytes ? - quot -af
23.Display the no.of active established connections to localhost ? - netstat -a | grep EST
25.Display the parent/child tree of a process ? - ptree <pid> Example: ptree 1267
26.Show the working directory of a process ? - pwdx <pid> Example: pwdx 1267
27.Display the processes current open files ? - pfiles <pid> Example: pfiles 1267
29.Display the top most process utilizing most CPU ? - top –b 1
6 Coll Interview:
Partition sizes can be set
View
manually or from what
Answer
configuration?
What field will cause the message Your password has expired to View
be displayed to the user? Answer
View
How many cpus we can connect to a spark machine in Solaris?
Answer
View
Search for a sample string in particular files?
Answer
View
Explain about kadmin command?
Answer
View
What command enables a printer?
Answer
View
Explain about the command ls?
Answer
View
What is sticky bit?
Answer
What file controls global variables for system wide values for View
the Bourne Shell? Answer
View
What is after the VTOC on the root filesystem?
Answer
What flag used with patchadd will prevent a later back out by
View
preventing patchadd from backing up files? If this flag is used,
Answer
the patch cannot be removed.
How would you find out what version of Solaris is currently View
running? Answer