Quick Dummies guide for Solaris/Unix/Linux

Quick Dummies guide for Solaris/Unix/Linux:-

Here are some quick commands for Solaris administrators :- (Most of these commands will work on Unix and Linux as well, this article is written for Solaris 8/9/10 servers, also note that all or most these commands will need root access, without which they may not work)

1) netstat :- it will give you the details of all ports that are on the system along with the port status

e.g. bash# netstat -as | grep 10000
(this will check status of port 10000)




 2) ps - to check for processes

e.g. bash# ps -ef | grep vnc
(this command will check the current processes list for any vnc application running)


3) Restarting a service on your solaris machine

e.g. bash# /etc/init.d/"service_name" restart/start/stop

(All services are installed under /etc/init.d/, here service name is the name of the service you need to start/stop or restart)

4) find - For searching files

e.g. bash# find /local/home -name abc
(it will search the under directory "/local /home" for file called "abc")


5) format - this command is like fdisk in windows it will show you all disk partitions of one or more physical disks

e.g. bash# format
(this command will list all the disks that are connected to the system)

6) svcs - to check if service is running (on Solaris 8/9)

e.g. bash# svcs ftp enable
(this will enable the FTP service on the server on Solaris 8/9)


7) svcadm - to check if service is running (on Solaris 10)

e.g. bash# svcadm ftp enable
(this will enable the FTP service on the server on Solaris 10)


8) /etc/vfstab - this is a file which is read on system boot

(if you have other machines mounted on your server and you need these mounts to be accessible even after the system is rebooted.)

e.g. bash# vi /etc/vfstab (or you can just type cat /etc/vfstab)

9) reboot :- To restart the server

e.g. bash# reboot

10) uname :- last but not the least server name and details
(this command will give you the version number or name of the system that yuo are working on)

e.g. bash# uname -a
(system name with details e.g what version and build)

11) hostname :- supposing you are working on multiple machines and you need to be certain which machine your running the command on

e.g. bash# hostname

12) scp - secure file copy

e.g. bash# scp machine1:/tmp/abc /tmp
(it will copy file from machine1:/tmp/abc to the current system under /tmp)

13) rcp - remote file copy

e.g. bash# rcp machine1:/tmp/abc /tmp
(it will copy file from machine1:/tmp/abc to the current system under /tmp)

14) rsh - is a remote shell connection to a server

e.g. bash# rsh machine1
(you can directly start an rsh session within another server)

15) ssh - is a Secure Shell Connection to a server
(you can directly start an SSH session within another server, if ssh has been enabled on that server)

e.g. bash# ssh servername


16) df - will show you if you have any folders mounted on the machine.

e.g. bash# df

17) mount - mount is used temporarily attach a resource to the system (local or remote)


e.g. bash# mount machine1:/local/folder1/ /tmp
(this command will mount the folder1 from machine1 on your current machine under /tmp all files from that machine will be available on this machine)

No comments:

Post a Comment