Get Started
|
Kernel |
The kernel is the heart of the operating system. It interacts with the hardware and most of the tasks like memory management, task scheduling and file management. |
Shell |
The shell is the utility that processes your requests. When you type in a command at your terminal, the shell interprets the command and calls the program that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are the most famous shells which are available with most of the Unix variants. |
Commands and Utilities |
There are various commands and utilities which you can make use of in your day to day activities. cp, mv, cat and grep, etc. are few examples of commands and utilities. There are over 250 standard commands plus numerous others provided through 3rd party software. All the commands come along with various options. |
Files and Directories |
All the data of Unix is organized into files. All files are then organized into directories. These directories are further organized into a tree-like structure called the filesystem. |
Examples |
- login
- passwd
- cal
- ls
- whoami
- users, who, w
- logout
- halt, init 0, init 6, poweroff, reboot, shutdown
|
|
|
File Management |
Files' Type |
Ordinary Files |
An ordinary file is a file on the system that contains data, text, or program instructions. |
Directories |
Directories store both special and ordinary files. For users familiar with Windows or Mac OS, Unix directories are equivalent to folders. |
Special Files |
Some special files provide access to hardware such as hard drives, CD-ROM drives, modems, and Ethernet adapters. Other special files are similar to aliases or shortcuts and enable you to access a single file using different names. |
|
Listing Files |
ls |
|
ls -l |
$ls -l
total 1962188
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 root 4096 Dec 9 2007 urlspedia
-rw-r--r-- 1 root root 276480 Dec 9 2007 urlspedia.tar
drwxr-xr-x 8 root root 4096 Nov 25 2007 usr
drwxr-xr-x 2 200 300 4096 Nov 25 2007 webthumb-1.01
-rwxr-xr-x 1 root root 3192 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 amrood 166255 Aug 9 2007 yourfile.swf
drwxr-xr-x 11 amrood amrood 4096 May 29 2007 zlib-1.2.3
$
First Column |
Represents the file type and the permission given on the file. Below is the description of all type of files.
- |
Regular file, such as an ASCII text file, binary executable, or hard link. |
b |
Block special file. Block input/output device file such as a physical hard drive. |
c |
Character special file. Raw input/output device file such as a physical hard drive. |
d |
Directory file that contains a listing of other files and directories. |
l |
Symbolic link file. Links on any regular file. |
p |
Named pipe. A mechanism for interprocess communications. |
s |
Socket used for interprocess communication. |
|
Second Column |
Represents the number of memory blocks taken by the file or directory. |
Third Column |
Represents the owner of the file. This is the Unix user who created this file. |
Fourth Column |
Represents the group of the owner. Every Unix user will have an associated group. |
Fifth Column |
Represents the file size in bytes. |
Sixth Column |
Represents the date and the time when this file was created or modified for the last time. |
Seventh Column |
Represents the file or the directory name. |
|
ls -a |
|
|
Metacharacters |
* |
to match 0 or more characters |
? |
to match with a single character |
|
Hidden Files |
An invisible file is one, the first character of which is the dot or the period character (.). Unix programs (including the shell) use most of these files to store configuration information. |
Creating Files |
|
Editing Files |
|
Display Content of a File |
|
Counting Words in a File |
wc filename1( filename2 ...)
$ wc filename
2 19 103 filename
$
First Column |
Represents the total number of lines in the file. |
Second Column |
Represents the total number of words in the file. |
Third Column |
Represents the total number of bytes in the file. This is the actual size of the file. |
Fourth Column |
Represents the file name. |
|
Copying Files |
cp source_file destination_file
|
Renaming Files |
|
Deleting Files |
rm filename1 filename2 filename3
|
Standard Unix Streams |
stdin |
This is referred to as the standard input and the associated file descriptor is 0. This is also represented as STDIN. The Unix program will read the default input from STDIN |
stdout |
This is referred to as the standard output and the associated file descriptor is 1. This is also represented as STDOUT. The Unix program will write the default output at STDOUT |
stderr |
This is referred to as the standard error and the associated file descriptor is 2. This is also represented as STDERR. The Unix program will write all the error messages at STDERR. |
|
|
|
Directories
|
|
|
|
|
|
|
|
|
|
|
|
|
File Permission
|
|
|
|
|
|
|
|
|
|
|
|
|
Environment
|
|
|
|
|
|
|
|
|
|
|
|
|
Basic Utilities
|
|
|
|
|
|
|
|
|
|
|
|
|
Pipes & Filters
|
|
|
|
|
|
|
|
|
|
|
|
|
Processes
|
|
|
|
|
|
|
|
|
|
|
|
|
Communications
|
|
|
|
|
|
|
|
|
|
|
|
|
The vi Editor |
|
|
|
|
|
|
|
|
|
|
|
|