Basic Linux & Unix commands

Basic  Linux & Unix commands

100+ Important LINUX and UNIX Commands

  1. adduser ::-- Add a new user
  2. arch ::-- Print machine architecture
  3. awk ::-- Find and Replace text within file(s)
  4. bc ::-- An arbitrary precision calculator language
  5. cal ::--Display a calendar
  6. cat ::--Concatenate files and print on the standard output
  7. chdir ::--Change working directory
  8. chgrp ::--Change the group ownership of files
  9. chkconfig ::--Tool for maintaining the /etc/rc[0-6].d directory hierarchy
  10. chmod ::--Change the access permissions of files and directories
  11. chown ::--Change the user and group ownership of files
  12. chroot ::--Change root directory
  13. cksum ::--Print CRC checksum and byte counts
  14. clear ::--Clear terminal screen
  15. cmp ::--Compare two files
  16. comm ::--Compare two sorted files line by line
  17. cp ::--Copy one or more files to another location
  18. cron ::--Daemon to execute scheduled commands
  19. crontab ::--Schedule a command to run at a later time
  20. csplit ::--Split a file into context-determined pieces
  21. cut ::--Divide a file into several parts
  22. date ::--Display or change the date & time
  23. dc ::--Desk Calculator
  24. dd ::--Data Dump - Convert and copy a file
  25. df ::--Display free disk space
  26. diff ::-- Display the differences between two files
  27. diff3 ::--Show differences among three files
  28. dir ::--Briefly list directory contents
  29. dircolors ::-- Colour setup for `ls'
  30. dirname ::--Convert a full pathname to just a path
  31. du ::--Estimate file space usage
  32. echo ::-- Display message on screen
  33. ed ::-- A line-oriented text editor (edlin)
  34. egrep ::--Search file(s) for lines that match an extended expression
  35. eject ::--Eject CD-ROM
  36. env ::-- Display, set, or remove environment variables
  37. expand ::-- Convert tabs to spaces
  38. expr ::-- Evaluate expressions
  39. factor ::-- Print prime factors
  40. false ::-- Do nothing, unsuccessfully
  41. fdformat ::-- Low-level format a floppy disk
  42. fdisk ::-- Partition table manipulator for Linux
  43. fgrep ::-- Search file(s) for lines that match a fixed string
  44. find ::-- Search for files that meet a desired criteria
  45. fmt ::-- Reformat paragraph text
  46. fold ::-- Wrap text to fit a specified width
  47. format ::-- Format disks or tapes
  48. free ::-- Display memory usage
  49. fsck ::-- Filesystem consistency check and repair
  50. gawk ::-- Find and Replace text within file(s)
  51. grep ::-- Search file(s) for lines that match a given pattern
  52. groups ::-- Print group names a user is in
  53. gzip ::-- Compress or decompress named file(s)
  54. head ::-- Output the first part of file(s)
  55. hostname ::-- Print or set system name
  56. id ::-- Print user and group id's
  57. info ::-- Help info
  58. install ::-- Copy files and set attributes
  59. join ::-- Join lines on a common field
  60. kill ::-- Stop a process from running
  61. less ::-- Display output one screen at a time
  62. ln ::-- Make links between files
  63. locate ::-- Find files
  64. logname ::-- Print current login name
  65. lpc ::-- Line printer control program
  66. lpr ::-- Off line print
  67. lprm ::-- Remove jobs from the print queue
  68. ls ::-- List information about file(s)
  69. man ::-- Help manual
  70. mkdir ::-- Create new folder(s)
  71. mkfifo ::-- Make FIFOs (named pipes)
  72. mknod ::-- Make block or character special files
  73. more ::-- Display output one screen at a time
  74. mount ::-- Mount a file system
  75. mv ::-- Move or rename files or directories
  76. nice ::-- Set the priority of a command or job
  77. nl ::-- Number lines and write files
  78. nohup ::-- Run a command immune to hangups
  79. passwd ::-- Modify a user password
  80. paste ::-- Merge lines of files
  81. pathchk ::-- Check file name portability
  82. pr ::-- Convert text files for printing
  83. Printcap ::-- Printer capability database
  84. printenv ::-- Print environment variables
  85. printf ::-- Format and print data
  86. ps ::-- Process status
  87. pwd ::-- Print Working Directory
  88. quota ::-- Display disk usage and limits
  89. quotacheck ::-- Scan a file system for disk usage
  90. quotactl ::-- Set disk quotas
  91. ram ::-- ram disk device
  92. rcp ::-- Copy files between two machines
  93. rm ::-- Remove files
  94. rmdir ::-  Remove folder(s)
  95. rpm ::-- Remote Package Manager
  96. rsync ::-- Remote file copy (Synchronize file trees)
  97. screen ::-- Terminal window manager
  98. sdiff ::-- Merge two files interactively
  99. sed ::-- Stream Editor
  100. select ::-- Accept keyboard input
  101. seq ::-- Print numeric sequences
  102. shutdown ::-- Shutdown or restart linux
  103. sleep ::-- Delay for a specified time
  104. sort ::-- Sort text files
  105. split ::-- Split a file into fixed-size pieces
  106. su ::-- Substitute user identity
  107. sum ::-- Print a checksum for a file
  108. symlink ::-- Make a new name for a file
  109. sync ::-- Synchronize data on disk with memory
  110. tac ::-- Concatenate and write files in reverse
  111. tail ::-- Output the last part of files
  112. tar ::-- Tape Archiver
  113. tee ::-- Redirect output to multiple files
  114. test ::-- Evaluate a conditional expression
  115. time ::-- Measure Program Resource Use
  116. touch ::-- Change file timestamps
  117. top ::-- List processes running on the system
  118. traceroute ::-- Trace Route to Host
  119. tr ::-- Translate, squeeze, and/or delete characters
  120. true ::-- Do nothing, successfully
  121. tsort ::-- Topological sort
  122. tty ::-- Print filename of terminal on stdin
  123. umount ::-- Unmount a device
  124. uname ::-- Print system information
  125. unexpand ::-- Convert spaces to tabs
  126. uniq ::-- Uniquify files
  127. units ::-- Convert units from one scale to another
  128. unshar ::-- Unpack shell archive scripts
  129. useradd ::-- Create new user account
  130. usermod ::-- Modify user account
  131. users ::-- List users currently logged in
  132. uuencode ::-- Encode a binary file
  133. uudecode ::-- Decode a file created by uuencode
  134. vdir ::-- Verbosely list directory contents (`ls -l -b')
  135. watch ::-- Execute/display a program periodically
  136. wc ::-- Print byte, word, and line counts
  137. whereis ::-- Report all known instances of a command
  138. which ::-- Locate a program file in the user's path
  139. who ::-- Print all usernames currently logged in
  140. whoami ::-- Print the current user name
  141. xargs ::-- Execute utility, passing constructed argument list(s)
  142. yes ::-- Print a string until interrupted

How to Prevent Yum update of some selected packages in Redhat/Fedora

 How to Prevent Yum update of some selected packages in Redhat/Redhat

It is very Simple to exclude some selected packages not to update while using yum update command
All you need to do is add an exclude line to the end of your [main] section in /etc/yum.conf .
Your /etc/yum.conf should look something like this:
exclude= hal bash*

This will prevent upgrades of the hal package as well as bash package while using yum update cmd. The list of apps in the exclude should be space sepeated. Shell wildcards ( * ? ) can also be included.

From the desk of Amit Maheshwari

Understanding Booting Process in LINUX

 Understanding Booting Process in LINUX

The Booting process is the first process that is executed when you start a Linux system. 
This process is executed in the following steps: 
1. The processor searches for the Basic Input/Output System (BIOS) program in the 
memory and executes it. BIOS is a program that provides the lowest level interface to 
the devices, such as the hard disk, monitor, and mouse, of the system.  
2. BIOS runs the Power-On Self Test (POST) program, which checks the system 
hardware by verifying the hardware configuration information. The program does this 
to ensure that all the required hardware devices are present and functioning properly.  
3. BIOS checks the system memory for errors and searches for a bootable device. The 
bootable device may either be the hard disk or other bootable devices, such as a CD-
ROM or a diskette drive. The sequence in which BIOS searches for the various 
devices for the boot record is called the booting sequence
You can specify the booting sequence by editing the booting sequence information in the 
BIOS setup program. To enter the BIOS setup program, you need to press the or 
key on the first boot up screen. The boot sequence can be specified as CD-
ROM, C, A, where C represents the hard drive and A represents the diskette drive. In the 
preceding boot sequence, BIOS will first search the CD-ROM for the boot record, then 
search the hard drive and in the end search the diskette. The following list describes the 
sequence in which the boot loader is invoked and loaded: 
4. BIOS checks the bootable device for the presence of the Master Boot Record (MBR), 
which is the first sector of the bootable device. The MBR is 512 bytes in size and 
consists of a boot loader and a partition table. The boot loader contains instructions in 
the form of machine code for booting the system. The partition table contains 
information about the various partitions of the storage devices, such as the size of the 
various partitions and the names of the partitions.  
5. BIOS locates and invokes the boot loader by passing the control of the system to the 
Initial Program Loader (IPL), also called the first stage of the boot loader, which is 
present in the MBR.  
6. IPL loads the boot loader in the system memory.  

The boot loader takes the control of the system from the IPL when it is loaded into the 

memory of the system.

GRUB Configuration File 
The GRUB configuration file specifies the various commands that are used to set the 
global preferences of the system. The global preferences are the parameters that are not 
specific to any operating system and are applicable to the entire menu interface of GRUB. 
These preferences are followed by the commands specific to each operating system listed 
on the menu interface.  
The default location of grub.conf in the filesystem is /boot/grub/grub.conf. A sample 
grub.conf file of a system having RHEL5 is shown below: 

title Red Hat Enterprise Linux ES (2.6.18-5.EL5) 
  root (hd0,0) 
  kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/ rhgb quiet 
  initrd /initrd-2.6.18-5.EL5.img 
A sample grub.conf file of a system having RHEL5 and Windows XP operating systems 
is shown below:

title Red Hat Enterprise Linux ES (2.6.18-5.EL5) 
  root (hd0,0) 
  kernel /vmlinuz-2.6.18-5.EL5  ro root=LABEL=/ rhgb quiet 
  initrd /initrd-2.6.18-5.EL5.img 
title Windows  
rootnoverify (hd0,0) 
chainloader +1 

In the preceding grub.conf file the various configuration directives are: 
· default: Specifies default operating system to load 
· timeout: Specifies the time interval, in seconds, GRUB waits for user to select an 
operating system from GRUB menu 
· splashimage: Specifies the absolute path of the image shown by GRUB on screen at bootup 
· hiddenmenu: Specifies GRUB to hide the menu until user presses a key 
· title: Specifies the OS name shown in GRUB menu  
· root: Specifies the partition where grub is installed 
· kernel: Specifies the absolute path of the kernel file to load and label of root partition 
· initrd: Specifies the absolute path of the initial RAM disk
· rootnoverify: Specifies the root partition to be used by GRUB but does not mount the partition 
· chainloader: Specifies GRUB to load the file as a chain loader 

Created By Amit Maheshwari 


Twitter Delicious Facebook Digg Stumbleupon Favorites More