May 23, 2021 UNIX Getting started
The UNIX operating system is a series of programs that connect computers to users.
A computer program that allocates system resources and coordinates all the details within a computer is called an operating system or kernel.
The user communicates through a program kernel called a shell. T he shell is a command-line interpreter; It converts user-entered commands and converts them into a language that the kernel can understand.
Here is a basic block diagram of the UNIX system:
The main concepts that summarize all versions of UNIX contain four basic elements:
If you have a computer with the UNIX operating system installed, then you just need to power it on and make it run.
As soon as you turn on the power, the system starts to start, and finally it prompts you to log on to the system, log on to the system and use it for your day-to-day activities.
When you first connect to a UNIX system, you'll usually see the following tips:
login:
login : amrood
amrood's password:
Last login: Sun Jun 14 09:32:32 2009 from 62.61.164.73
$
You'll be provided with (sometimes called a $ prompt) with a command prompt, and you can type all your commands below. For example, to check your calendar, you need to type the cal command, as follows:
$ cal
June 2009
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
$
All UNIX systems require a password to ensure the security of your files and data, a constraint that protects your files from hackers. Here are the steps to change your password:
To begin, type passwd at the command prompt as follows.
Please enter your old password, which is the one you are currently using.
Enter your new password. A lways keep your password complex enough that no one can guess it. But only if you remember.
$ passwd
Changing password for amrood
(current) Unix password:******
New UNIX password:*******
Retype new UNIX password:*******
passwd: all authentication tokens updated successfully
$
Note: I use star ( ) to tell you that's where you entered the current password and the new password, which don't appear directly when you type characters, but instead replace them with numbers.
All data in UNIX is organized into files. A ll files are organized into directories. These directories are organized into a tree structure called a file system.
You can use the ls command to list all files or directories in the directory. The following is an example of using the ls command with the -l option.
$ ls -l
total 19621
drwxrwxr-x 2 amrood amrood 4096 Dec 25 09:59 uml
-rw-rw-r-- 1 amrood amrood 5341 Dec 25 08:38 uml.jpg
drwxr-xr-x 2 amrood amrood 4096 Feb 15 2006 univ
drwxr-xr-x 2 root root4096 Dec 9 2007 urlspedia
-rw-r--r-- 1 root root 276480 Dec 9 2007 urlspedia.tar
drwxr-xr-x 8 root root4096 Nov 25 2007 usr
-rwxr-xr-x 1 root root3192 Nov 25 2007 webthumb.php
-rw-rw-r-- 1 amrood amrood 20480 Nov 25 2007 webthumb.tar
-rw-rw-r-- 1 amrood amrood 5654 Aug 9 2007 yourfile.mid
-rw-rw-r-- 1 amrood amrood166255 Aug 9 2007 yourfile.swf
$
The directory is represented here, beginning with d... For example, uml, univ, and urlspedia are directories, and the rest are files.
When you log on to the system, you may want to know: Who I am ?
The easiest way to find out who you are is to enter the whoami command:
$ whoami
amrood
$
Give it a try on your system. T his command lists the account names associated with the current login. You can try the who am i command to get information about yourself.
Sometimes you may want to know who logs on to the computer at the same time.
Here are three commands that you can use to get this information based on how much you want to know about other users: users, who, and w.
$ users
amrood bablu qadir
$ who
amrood ttyp0 Oct 8 14:10 (limbo)
bablu ttyp2 Oct 4 09:08 (calliope)
qadir ttyp4 Oct 8 12:09 (dent)
$
Try the w command on your system to check the output. This lists some more information associated with the user recorded in the system.
When you finish your session, you need to log out of your system and make sure no one else pretends to be you to access your files.
The most consistent way to shut down a UNIX system is to correctly use one of the following commands from the command line:
Command | Describe |
---|---|
halt | Shut down the system immediately. |
init 0 | Use predefined scripts to synchronize and clean up your system before shuting down. |
init 6 | Restart the system after it is completely shut down, and then back it up completely |
poweroff | Turn off the system automatically by powering off. |
reboot | Restart |
shutdown | Shutdown |
You typically need a super user or root (the most privileged account on a UNIX system) to shut down the system, but on some unIX machines owned by individuals or individuals, administrator users can do so even regular users.