So I am assuming you have successfully installed Sun Solaris 10 and you are able to login to the final or the Gui. This tutorial will go over all the basic settings and how to make changes. After you have mastered how to edit the basic settings of Sun Solaris 10 you can read my other articles on how to setup services such as apache, mysql, dns, and others.
The Terminal
Let's first set in motion the terminal. If you are using the Java Gui, click on the set in motion button then navigate to Application -> Utilities -> Terminal. Or plainly right click on the desktop area and settle on the option to set in motion the final from the pop up window. The final window should open and you should now be able to run commands. If you are new to Linux/Unix this is the most foremost tool in your arsenal. It allows you to pretty much do anything, it's the Terminal. I regularly use all of my Linux and Unix servers through an Ssh client and always in terminal/command mode.
Solaris 10
When you set in motion the final as root, you are probably presented with a # sign at the starting of the line your cursor is blinking on. This is the Bourne shell. I prefer to work in the bash shell, so I will type bash at the command line like so, and press the enter key:
# bash
Then you should have a new line with your blinking cursor like so:
bash - 3.00#
If you wish to switch back to the Bourne shell, plainly type sh at the prompt and hit enter.
Some Basic Bash final Commands And Software
You should know some basic ways to use the final and commands that you can use. I will briefly go over a few, so please feel free to experiment and play around with these.
man - the man pages are your best friend. They will tell you pretty much all things about the software or command you wish to know. Try it out, type man vi, or man echo. Use the spacebar to scroll down in a man page and type q to quit out of the man page.
vi - This is the default text editor on all Unix and Linux machines. It has an highly difficult learning curve, so you will notice in most of my articles I will have the emacs text editor installed and used in my tutorials. It's easier for beginners and much similar to other text editors in the Windows environment. Any way I do encourage to use vi as it is a considerable tool.
Ctrl-Z - This keyboard command will pause the current software or process running in your shell by putting it in the background. It will exit you out to the shell and put you back at the command prompt.
fg - foreground. This command returns you back to the software that you previously paused and put in the background.
Ctrl-C - Exits a currently running process. It's like halt command that soldiery the process to stop without the option to resume it.
pwd - This command will yield your current working directory (the directory you are currently in)
cd - change directory
tail - deliver the last part of a file
head - deliver the first part of a file
ls - list the contents of the directory. There are any options you can add to this command to display more detailed information. For example ls -l.
which - Shows where in your path this file is. So if you type which vi, it will show you the path to the vi executable.
whoami - display who you are in case you forgot?:+) This is beneficial if you want to know either or not you are currently root or your own user.
rm -R (filename) - Deletes a file on your system
rm -Rf - deletes a portfolio on your ideas even if it has subfolders or files
mkdir - Makes a directory on your file system.
alias - Used to create aliases on your ideas to save you time typing out the full command. For example: alias e=emacs, then I can just type e when I want to set in motion emacs.
mv - moves a portfolio or file from one location to another, can also be used to rename folders and files.
chmod - To change the permissions on files.
chown - To change the owner and group properties of a file or folder.
ps - displays all processes your user is currently running. Type ps -e to display All Processes on the ideas currently running. To have even more detail try ps -ef
kill - use to kill a process. regularly used by typing
killall- Not supported on Sun Solaris 10. Try using a creative way such as find or grep with the kill command.
# kill -9 (processId) ProcessId is gotten by using ps to display all currently running processes.
I could write this section for days and with pages and pages of text. So I will stop there. As you go through my tutorials I will use other commands that I have not mentioned, but I believe you will be able to learn what these commands are doing and will be able to start using them on your own. So let's continue.
Useradd
Let's first create ourselves a user. We can do this manually by adding the foremost details in the /etc/passwd file and others, or we can just use the useradd command. We can plainly type
bash - 3.00#useradd josh
This will auto create Josh's home directory and the entry in the appropriate ideas files. We could even specify more details in this command such as the location of the folder:
bash - 3.00# useradd -d /export/home/josh -m -s /usr/bin/bash josh
This sets the user Josh's home directory in /export/home/josh and his default shell to the bash shell.
You can check the /etc/passwd file by typing
bash - 3.00#vi /etc/passwd
If you had just typed useradd josh at the terminal, you would have the last line of your /etc/passwd file look something like this:
josh:x:100:1::/home/josh:/bin/sh
This means Josh's default shell would be the bourne shell. Since we are using bash shell for most of our examples, you should edit this line to look like this:
josh:x:100:1::/export/home/josh:/bin/bash
then you will want to create the users directory:
# mkdir /export/home/josh
# chown josh:other /export/home/josh
We have now setup the directory that the user josh will use as his home directory.
Passwd
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 wish to be this new user, just type the final command "su" to switch user followed by the username.
bash - 3.00#su josh
Whoami
Check to see if you have successfully switched to user josh.
bash - 3.00#whoami
If this gives you an answer of bash: whoami: command not found. This is because whoami is not listed in your path. I will interpret Path next. So for now let's just create a symbolic link in the directory that your current Path changeable has in it. So type echo $Path. You might get an answer like this: /usr/bin. This means when you run a command at the terminal, it only looks in this portfolio for executables. So let's add a symbolic link to the whoami executable in the /usr/bin folder. I will use the find command to located the whoami executable. I will interpret how to use find later. You will need to be root to do this. So first su to root.
bash - 3.00# su root # ln -s /usr/ucb/whoami /usr/bin/whoami # exit bash - 3.00$ whoami josh
It worked, the whoami executable now has a symbolic link in the /usr/bin portfolio and this path is in the user josh's path so I am able to call it from the command line.
Path
You may perceive a qoute when you try to ping google in our next test. It might say
-bash: ping: command not found.
This is because the path to the executable ping is not in any of the paths listed in your Path variable. Type echo $Path at the command prompt to see what your Path changeable contains. It will probably be /usr/bin
Now if you want you can add paths to your $Path variable, do this:
export Path=$Path:/path/your/want
Path goes from left to right when it analyzes the portfolio locations in the path variable. So be aware of this, as it might run a dissimilar executable if that executable is in one of the paths earlier in the list.
If you just export your $Path changeable it will be lost when you create a new final session or logoff and logon. You need to edit or create a.profile file in your user's home directory and add a line so that the path is created each time you login.
Let's su to root. So type su root at the prompt to become root again. Then type which ping, this will tell you the location to where ping's executable is located. It should give you an answer of /usr/sbin/ping. So let's add this path to our Path changeable in our.profile file.
# cd ~
# vi.profile
cd ~ takes you to your home directory. Then vi.profile either opens the file if it exists or creates a new one. Now you want to add a line to that file that looks like below:
export Path=$Path:/usr/sbin;
Save the.profile file, logout and login. Then type echo $Path to see if your path changeable is now displaying:
/usr/bin:/usr/sbin
If so, you have successfully added the path to your Path variable.
Ifconfig
Let's first figure out what our Ip address is and to make sure we are live on the internet. First try a easy ping test to google.
bash - 3.00# ping google.com
You should get a response of "google.com is alive". This means you are live and able to entrance the internet. Let's take a look at how are Ethernet card is configured.
To check ethernet card gadget or Ip address type:
ifconfig -a
This command is nice if you have no idea what your gadget name is and it's the first time you installed your new network card. You should have some result, regularly a appropriate network card would get the card name of bge0, but this all depends on your hardware and how it was installed. In my case its pcn0. So now if I want to check the status of this gadget I can type
# ifconfig pcn0
There are any other things you can do with ifconfig, such as set a static Ip address and turn off the device, and many others. Since we have internet, let's head somewhere to the next section.
Sun Solaris pkgadd, pkgrm, pkginfo
Solaris's container manager, very similar to Redhat's Rpm software. You can use these in the following way:
No comments:
Post a Comment