Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

10 December 2012

Difference Between Linux and UNIX

UNIX is copyrighted name only big companies are allowed to use the UNIX copyright and name, so IBM AIX and Sun Solaris and HP-UX all are UNIX operating systems. The Open Group holds the UNIX trademark in trust for the industry, and manages the UNIX trademark licensing program.

Most UNIX systems are commercial in nature.

Linux is a UNIX Clone

But if you consider Portable Operating System Interface (POSIX) standards then Linux can be considered as UNIX. To quote from Official Linux kernel README file:
Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX compliance.

However, "Open Group" do not approve of the construction "Unix-like", and consider it misuse of their UNIX trademark.

Linux Is Just a Kernel

Linux is just a kernel. All Linux distributions includes GUI system + GNU utilities (such as cp, mv, ls,date, bash etc) + installation & management tools + GNU c/c++ Compilers + Editors (vi) + and various applications (such as OpenOffice, Firefox). However, most UNIX operating systems are considered as a complete operating system as everything come from a single source or vendor.
As I said earlier Linux is just a kernel and Linux distribution makes it complete usable operating systems by adding various applications. Most UNIX operating systems comes with A-Z programs such as editor, compilers etc. For example HP-UX or Solaris comes with A-Z programs.

License and cost

Linux is Free (as in beer [freedom]). You can download it from the Internet or redistribute it under GNU licenses. You will see the best community support for Linux. Most UNIX like operating systems are not free (but this is changing fast, for example OpenSolaris UNIX). However, some Linux distributions such as Redhat / Novell provides additional Linux support, consultancy, bug fixing, and training for additional fees.

User-Friendly

Linux is considered as most user friendly UNIX like operating systems. It makes it easy to install sound card, flash players, and other desktop goodies. However, Apple OS X is most popular UNIX operating system for desktop usage.

Security Firewall Software

Linux comes with open source netfilter/iptables based firewall tool to protect your server and desktop from the crackers and hackers. UNIX operating systems comes with its own firewall product (for example Solaris UNIX comes with ipfilter based firewall) or you need to purchase a 3rd party software such as Checkpoint UNIX firewall.

Backup and Recovery Software

UNIX and Linux comes with different set of tools for backing up data to tape and other backup media. However, both of them share some common tools such as tar, dump/restore, and cpio etc.

File Systems

  • Linux by default supports and use ext3 or ext4 file systems.
  • UNIX comes with various file systems such as jfs, gpfs (AIX), jfs, gpfs (HP-UX), jfs, gpfs (Solaris).

System Administration Tools

  1. UNIX comes with its own tools such as SAM on HP-UX.
  2. Suse Linux comes with Yast
  3. Redhat Linux comes with its own gui tools called redhat-config-*.
However, editing text config file and typing commands are most popular options for sys admin work under UNIX and Linux.

System Startup Scripts

Almost every version of UNIX and Linux comes with system initialization script but they are located in different directories:
  1. HP-UX - /sbin/init.d
  2. AIX - /etc/rc.d/init.d
  3. Linux - /etc/init.d

End User Perspective

The differences are not that big for the average end user. They will use the same shell (e.g. bash or ksh) and other development tools such as Perl or Eclipse development tool.

System Administrator Perspective

Again, the differences are not that big for the system administrator. However, you may notice various differences while performing the following operations:
  1. Software installation procedure
  2. Hardware device names
  3. Various admin commands or utilities
  4. Software RAID devices and mirroring
  5. Logical volume management
  6. Package management
  7. Patch management

UNIX Operating System Names

A few popular names:
  1. HP-UX
  2. IBM AIX
  3. Sun Solairs
  4. Mac OS X
  5. IRIX

Linux Distribution (Operating System) Names

A few popular names:
  1. Redhat Enterprise Linux
  2. Fedora Linux
  3. Debian Linux
  4. Suse Enterprise Linux
  5. Ubuntu Linux

Common Things Between Linux & UNIX

Both share many common applications such as:
  1. GUI, file, and windows managers (KDE, Gnome)
  2. Shells (ksh, csh, bash)
  3. Various office applications such as OpenOffice.org
  4. Development tools (perl, php, python, GNU c/c++ compilers)

UNIX and Linux Hardware

Commercial UNIX hardware has more advanced initial boot options such as:
  • Decide how to boot
  • Check system health
  • Set hardware parameters etc
The BIOS that is standard in PCs which is used by Linux has few, of these features. UNIX hardware or servers are pretty expensive as compare to Linux server systems.

Further readings:

Following documents or URL should help anyone to get more idea:

 


09 January 2012

Rename Multiple Files Using Excel or Google Docs


Renaming multiples files on your Windows computer is easy. Select all the files, press F2 and type some descriptive text. Windows will append a unique sequence number to each of the file names.
That's a fairly quick solution but not very flexible because you don't get to specify any choices or criteria.
For instance, how do you append the current date to the filename ? Or you want to replace only certain words in the file names (like a spelling error)? Or you want files to follow a different renaming system like file-A.jpg instead of the default file(1).jpg.
To rename files in bulk more efficiently, you can either learn some complex shell scripting language (SED, AWK, Perl) or switch to something more simple  - a spreadsheet.
 
 Step 1: Type cmd and switch (using "cd" command) to the directory that contains the files you want to rename in bulk.
Step 2: Type "dir /b" to see a skeleton list of all files in the current directory. Copy that file list to the clipboard by selecting Mark from the contextual menu.
Step 3: The fun starts now. Fire your copy of Microsoft Excel or Google Docs Spreadsheets and paste those file names into the first spreadsheet column.
Step 4: In the blank adjacent column, add a corresponding Excel function - for instance, use SUBSTITUTE to change specific text in the filenames, use CONCATENATE() with DATE() if you want to add date to the filename, etc.
*For more complex criteria, you may want to put the file extensions in a separate column by splitting the file name using period (.) as the delimiter.
Step 5: Your source filenames are now in column A while the Destination files are in column B - we will now convert this into a DOS rename command.
In Column C, type the following Excel formula and your command is ready to be executed.
=CONCATENATE("ren ",A1, " ", B1)
Copy paste the same formula across all cells in column C for which you have corresponding values in Column A or B.
We are almost done. Copy all the values from column C to the clipboard and paste them inside the DOS window or better still, put them inside a new text file and give it a name like rename.bat.
 Execute and all files that match the criteria are renamed instantly...

18 July 2010

Basic UNIX Commands

         You must first logon to a UNIX machine. The method(s) to do this vary, so check with the facility you are aton how to logon.Once logged on, these commands are essential to learn. More information about them (and other commands)can be obtained by entering man command (short for manual). For example, to obtain a manual about the command cat, you would type man cat.

cat - List a file
USAGE: cat [ -n ] file...
OPTIONS: -n display line numbers.
EXAMPLES: cat myprog.c

cat -n myprog.c
cd - Change directory
USAGE: cd [ directory ]
EXAMPLES: cd

cd mysource
NOTE: The command cd with no arguments will take you to your home directory ( i.e.
the directory you start in when you first login to the system ).
The command cd .. will take you to the directory above the one you are in.

cp - Copy a file
USAGE: cp file1 file2
cp file1 ...directory
EXAMPLE: cp myprog.c myprog.1.save
NOTE: Suppose your instructor tells you to get a copy of the file firstprog.p that is in the
directory /u/mathcs/fs/ravi. The complete command to copy this file to the directory
you are in is:
cp /u/mathcs/fs/ravi/firstprog.p firstprog.p
It is important to note that the forward slash "/" is used to specify path names.

logout - Exit unix
USAGE: logout
NOTE: Where you are returned to when you logout is depending on the method used to login
to the unix system. If you try to logout and you get an error message
“there are stopped jobs”, then type a fg command to go back to that job, then
you can properly exit the session and logout.

ls - List the contents of the current directory
USAGE: ls [ file1... ]
EXAMPLES: ls
ls *.exe (this lists only files that end with the extension .exe)
ls pkzip.* (this lists only files that begin with pkzip and has any extension)

mkdir - Create a new directory
USAGE: mkdir directory...
EXAMPLE: mkdir junkdir

more - List a long file
USAGE: more file ...
EXAMPLES: more myprog.c
more a.c b.c c.c
NOTE: You can also use this with other unix commands that involves listing data.
EXAMPLES: finger |more
cat file |more

mv - Rename or move a file
USAGE: mv file1 file2
mv file1 ... directory
EXAMPLE: mv a.out myfirst

passwd - Change login passwd
USAGE: passwd
NOTE: As you type in the passwords, the characters are not displayed on the screen.

pwd - Display the current directory
USAGE: pwd
NOTE: pwd tells you which directory you are in.

rm - Remove file(s)
USAGE: rm file...
EXAMPLE: rm myfirst.old

rmdir - Remove an empty directory
USAGE: rmdir directory ...
EXAMPLE: rmdir junkdir
NOTE: In order to remove a directory that contains files, you must first remove the files with
rm and then remove the directory with rmdir.

finger - display information about local and remote users.
USAGE: finger
NOTE: If you use this command followed by a user’s login name, it will give some information
about that’s user’s account; directory route, last time he or she logged in, etc.
USAGE: finger user...
EXAMPLE: finger stsc

who - Identifies who is currently logged on the unix machine, but displays less information than
with the “finger” command.

USAGE: who
spell - It checks your documents for spelling errors using an online dictionary.
USAGE: spell file
EXAMPLE: spell commands.txt

Popular Posts