So I am assuming you have efficiently put in Solar Solaris 10 and you are equipped to login to the terminal or the GUI. This tutorial will go around all the essential options and how to make adjustments. Soon after you have mastered how to edit the standard configurations of Sun Solaris 10 you can go through my other content on how to setup expert services these kinds of as apache, mysql, dns, and others.
Let us very first start the terminal. If you are employing the JAVA GUI, click on the Launch button then navigate to Software -> Utilities -> Terminal. Or basically suitable click on on the desktop space and find the selection to start the terminal from the pop up window. The terminal window ought to open and you should really now be equipped to operate instructions. If you are new to Linux/Unix this is the most important tool in your arsenal. It allows you to fairly a lot do everything, it is the Terminal. I normally use all of my Linux and Unix servers through an SSH customer and usually in terminal/command method.
When you start the terminal as root, you are most likely introduced with a # indicator at the beginning of the line your cursor is blinking on. This is the Bourne shell. I desire to function in the bash shell, so I will form bash at the command line like so, and push the enter critical:
Then you really should have a new line with your blinking cursor like so:
bash – 3.00#
If you would like to swap back to the Bourne shell, simply just kind sh at the prompt and hit enter.
SOME Fundamental BASH TERMINAL Commands AND Computer software
You ought to know some fundamental means to use the terminal and instructions that you can use. I will briefly go about a handful of, so please experience no cost to experiment and play around with these.
person – the guy web pages are your best good friend. They will inform you very a great deal everything about the program or command you desire to know. Check out it out, form man vi, or person echo. Use the spacebar to scroll down in a male web page and variety q to stop out of the gentleman web page.
vi – This is the default textual content editor on all Unix and Linux devices. It has an very complicated studying curve, so you will see in most of my content articles I will have the emacs textual content editor put in and used in my tutorials. It is really a lot easier for rookies and a lot related to other textual content editors in the Home windows ecosystem. Nevertheless I do really encourage to use vi as it is a powerful resource.
Ctrl-Z – This keyboard command will pause the recent software or method functioning in your shell by placing it in the track record. It will exit you out to the shell and place you again at the command prompt.
fg – foreground. This command returns you back again to the program that you earlier paused and set in the background.
Ctrl-C – EXITS a at the moment running procedure. It is like halt command that forces the method to quit without having the possibility to resume it.
pwd – This command will output your recent doing the job directory (the directory you are presently in)
cd – improve listing
tail – deliver the very last component of a file
head – provide the very first aspect of a file
ls – checklist the contents of the listing. There are a number of selections you can increase to this command to display screen more in depth data. For illustration ls -l.
which – Displays where in your path this file is. So if you form which vi, it will demonstrate you the path to the vi executable.
whoami – exhibit who you are in situation you forgot?:+) This is useful if you want to know whether or not or not you are at present root or your very own consumer.
rm -R (filename) – Deletes a file on your technique
rm -Rf – deletes a folder on your procedure even if it has subfolders or data files
mkdir – Helps make a listing on your file program.
alias – Utilized to create aliases on your procedure to help save you time typing out the total command. For illustration: alias e=emacs, then I can just variety e when I want to launch emacs.
mv – moves a folder or file from 1 location to one more, can also be applied to rename folders and information.
chmod – To adjust the permissions on documents.
chown – To change the owner and group attributes of a file or folder.
ps – shows all processes your consumer is currently functioning. Form ps -e to display ALL Procedures on the Process at present working. To have even a lot more element test ps -ef
destroy – use to eliminate a procedure. Ordinarily made use of by typing
killall- NOT supported on Sunlight Solaris 10. Test working with a imaginative way this sort of as obtain or grep with the get rid of command.
# destroy -9 (processID) ProcessID is gotten by employing ps to display screen all at the moment functioning procedures.
I could publish this section for days and with webpages and webpages of textual content. So I will prevent there. As you go by my tutorials I will use other commands that I have not described, but I consider you will be capable to master what these commands are executing and will be in a position to start working with them on your very own. So let us carry on.
Let’s to start with produce ourselves a consumer. We can do this manually by introducing the critical information in the /etcetera/passwd file and other people, or we can just use the useradd command. We can basically sort
bash – 3.00#useradd josh
This will car build Josh’s home listing and the entry in the appropriate technique information. We could even specify more details in this command this sort of as the area of the folder:
bash – 3.00# useradd -d /export/household/josh -m -s /usr/bin/bash josh
This sets the user Josh’s property directory in /export/home/josh and his default shell to the bash shell.
You can examine the /and so on/passwd file by typing
bash – 3.00#vi /and so on/passwd
If you had just typed useradd josh at the terminal, you would have the previous line of your /and many others/passwd file seem one thing like this:
This indicates Josh’s default shell would be the bourne shell. Because we are employing bash shell for most of our examples, you ought to edit this line to look like this:
then you will want to build the customers directory:
# mkdir /export/dwelling/josh
# chown josh:other /export/dwelling/josh
We have now set up the directory that the person josh will use as his house listing.
Let’s give our new user a password.
bash – 3.00#passwd josh
Enter the password twice to confirm and then it will be set. No, if you would like to be this new user, just variety the terminal command “su” to change consumer followed by the username.
bash – 3.00#su josh
Look at to see if you have successfully switched to user josh.
bash – 3.00#whoami
If this provides you an answer of bash: whoami: command not located. This is due to the fact whoami is not stated in your route. I will reveal Route subsequent. So for now let’s just create a symbolic url in the directory that your present-day Path variable has in it. So sort echo $Route. You could possibly get an remedy like this: /usr/bin. This suggests when you run a command at the terminal, it only appears in this folder for executables. So let us insert a symbolic backlink to the whoami executable in the /usr/bin folder. I will use the locate command to situated the whoami executable. I will demonstrate how to use come across later on. You will want to be root to do this. So initial su to root.
bash – 3.00# su root
# ln -s /usr/ucb/whoami /usr/bin/whoami
bash – 3.00$ whoami
It labored, the whoami executable now has a symbolic backlink in the /usr/bin folder and this path is in the consumer josh’s route so I am able to connect with it from the command line.
You may possibly realize a challenge when you try out to ping Google in our upcoming examination. It may possibly say
-bash: ping: command not uncovered.
This is because the path to the executable ping is not in any of the paths shown in your Route variable. Form echo $Route at the command prompt to see what your Path variable contains. It will possibly be /usr/bin
Now if you want you can increase paths to your $Route variable, do this:
Path goes from left to right when it analyzes the folder areas in the route variable. So be conscious of this, as it may operate a diverse executable if that executable is in one of the paths before in the record.
If you just export your $Route variable it will be misplaced when you make a new terminal session or logoff and logon. You require to edit or build a.profile file in your user’s home directory and insert a line so that the route is designed every single time you login.
Let’s su to root. So sort su root at the prompt to develop into root once again. Then sort which ping, this will explain to you the area to where by ping’s executable is found. It should really give you an respond to of /usr/sbin/ping. So let us include this path to our Path variable in our.profile file.
# cd ~
cd ~ normally takes you to your home listing. Then vi.profile either opens the file if it exists or makes a new a person. Now you want to incorporate a line to that file that seems like beneath:
Preserve the.profile file, logout and login. Then variety echo $Route to see if your route variable is now displaying:
If so, you have efficiently included the path to your Route variable.
Let’s very first determine out what our IP address is and to make positive we are dwell on the internet. 1st try out a straightforward ping examination to google.
bash – 3.00# ping google.com
You ought to get a response of “google.com is alive”. This indicates you are dwell and in a position to accessibility the world-wide-web. Let’s consider a glance at how are Ethernet card is configured.
To check ethernet card device or IP deal with form:
This command is nice if you have no concept what your gadget name is and it’s the to start with time you put in your new community card. You should have some result, normally a regular network card would get the card title of bge0, but this all relies upon on your hardware and how it was put in. In my scenario its pcn0. So now if I want to verify the standing of this system I can sort
# ifconfig pcn0
There are many other issues you can do with ifconfig, this kind of as set a static IP address and change off the system, and several some others. Since we have internet, let’s progress to the subsequent portion.
Sunshine SOLARIS pkgadd, pkgrm, pkginfo
Solaris’s package supervisor, incredibly very similar to Redhat’s RPM software. You can use these in the adhering to way:
This will set up offer on your technique, if its in the variety of a Sunshine Solaris offer.
#pkgadd -d . com
This will put in a bundle directly from the internet
This will take out a deal from your process
This will list all offers at this time set up. If you are checking for a unique offer, test:
#pkginfo | grep packagename
You can also checklist deals based on the type of package, test:
#pkginfo -c software
Find out thorough information and facts about the offer installed by typing this:
# pkginfo packagename
Let us 1st set up and configure
## Download Complete
The following packages are available:
1 CSWpkgget pkg_get – CSW version of automated package download tool
Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]:
Type “all” and hit enter to continue and then input y for all preceding questions. After you answer “y” to all the questions it should finish installing and give you an answer of “Installation of was successful.”
Now you can start using the pkg-get software to install your packages. Now edit the config file and change unstable to stable so we only download stable releases.
There are two pkg-get.conf files, which can lead to confusion. The locations are: /opt/csw/etc/pkg-get.conf and /etc/pkg-get.conf. The one that is being used by pkg-get is more than likely /etc/pkg-get.conf, so let’s edit this file.
# vi /etc/pkg-get.conf
Look for this line:
You should comment out this line and uncomment the line:
and change the above line to:
Ways to use pkg-get
This will list all currently installed software by pkg-get.
This will list all available software to install
this updates the internal catalog which stores the list of available software to install.
Not to be confused with -U, the lowercase u upgrades already installed packages if possible.
man pkg-get to find out more.
Use the unix find command to find your file or directory
You will use the software in the following way:
# find. -name file_name
the “.” implies to search in the current directory, you could do something like this to search for all files within the root directory
# find / -name file_name
Try always using file_name* so that it matches words that are file_name_something_else. The find function is very literal and only looks for exact matches. This function will come in handle when you are trying to locate executables and other files.
Before we can start using pkg-get we need to locate the executable on your system. You will notice if you type pkg-get at your command prompt, you will get a command not found message. So let’s find it.
# find / -name pkg-get
This can take quite some time as it will search through all files on your server. You can always cancel this action with a Ctrl-C key interrupt. The results you should get from the above command are something like this:
# find / -name pkg-get
The /opt/csw/bin/pkg-get is the file we want. Do you remember how to create a symbolic link?
# ln -s /opt/csw/bin/pkg-get /usr/bin/pkg-get
Now you can call this function from your command line. Let’s update our pkg-get contents and then install wget
# pkg-get -U
# pkg-get -i wget
Now the executable for wget will be installed in /opt/csw/bin/. Since we will be using the pkg-get from blastwave to install a lot of our packages, most of the executables will be installed in the /opt/csw/bin/ folder, so we should probably add this to our.profile file.
Make your export PATH line look like this:
Save and exit vi.
Now that we have a working package installer by using blastware’s online directory. We can go ahead and install some additional software tools to use.
#pkg-get -i emacs
Let this install all the needed files and dependencies. Just select y to install all needed software, this install might take some time as it requires a lot of other libraries, but it’s okay, because most of these libraries will be required by other packages we are going to install.
Now emacs should finish installing and you can go ahead and run emacs. Let’s go over some basic functions of emacs.
# emacs testfile
This will launch the editor. The first thing you will notice is that you don’t have multiple modes like in vi. So you can just move around your document with the arrow keys and just start typing when you want to. There are many key combinations you can use like in vi, but I will just go over a few.
Ctrl-kk – This deletes the line you are currently on.
Ctrl-x u – This means hold down the control key and press x, then release the control key and press u. This will undo the last change you made.
Ctrl-x-s – Saves your document
Ctrl-x-c – Quits emacs
Ctrl-s – Searches your document. Just type in a word or phrase after hitting Ctrl-s and then hit enter to search your document.
That should help you get started. Enjoy emacs, and once you become more comfortable with Unix/Linux try learning vi or vim.
Most of us are probably more familiar with GNUTAR than Unix Tar. By default Sun Solaris has the Unix version of Tar installed. Let’s go ahead and install GNUtar on our system.
# pkg-get -I gtar
Now you will have gtar installed and you can use it just like you would use it with your Linux systems.
Let’s say we want to compress the directory /export/home/josh/. You will do the following:
# gtar czvf backup.tar.gz /export/home/josh
Let’s say we want to extract this folder.
# gtar xzvf backup.tar.gz
There is a really easy way to remember which four letters you need to use. The V stands for verbose (output the results to the screen while it compresses, you could leave out the v so its in silent mode). The C stands for compress whereas the X stands for eXtract. The f stands for force and the Z tells tar to Gzip the archive as well. Pretty simple when you understand what each letter means, now you should not have an excuse for forgetting these 5 letters and when to use them.
Before we conclude this tutorial, there is one last thing I would like to go over. We have been using the terminal for pretty much everything up till now. While writing this guide I was using mostly my windows SSH client to connect to my Solaris Server to make sure all the above functions were working as they should be. But you are probably using the terminal in your nice JAVA GUI. When you initially installed Sun Solaris in my first tutorial you probably just installed the default configuration. So there might be a lot of software that you don’t need or want installed. Sun Solaris 10 has a nice graphical add/remove program software called Solaris Product Registry. To launch it type the following in your terminal:
# prodreg &
The ampersand signs forces the job to be put in the background so it will run and return the user to the terminal prompt so he/she can continue working via the terminal.
The Product Registry program will look something like below:
The unclassified software group will usually contain the software we install with blastwave’s pkg-get software. Everything under Solaris 10 System Software folder is software installed during the initial setup or packages made and offered by Sun. You can easily remove software from this application by just selecting the software you don’t need and clicking the Uninstall…. Button. That’s it. And that concludes this intro guide to Sun Solaris 10. I hope you enjoyed. Please check my other tutorials for more advanced settings post Solaris install.