Thursday, August 18, 2011

Linux Basics - I

Now a days Linux/Unix has become the most popular OS and most of the companies are expecting testers to have basic Linux knowledge. So I thought it would be good to share few tips while working on linux for no voice testers.


  • Many web servers are said to have a "LAMP" configuration - an acronym for Linux, Apache, MySQL, PHP 
  • "TUX" the penguin is the logo of the Linux operating system. It commemorates and incidet in which Linus Torvalds, while on vacation in southern hemisphere was bitten on the hand by a penguin
  • In Linux Commands are space and case sensitive
  • Do not log in as root, unless you must do so to administer the system. Instead, use the 'su' command to assume root status. 
  • Directories and sub directories are the same thing as folders in Windows
  • Notice that the slashes that seperate directories in Unix are forward slashes (/), not backward slashes (\).
  •  You can display the last few commands you entered by repeatedly pressing the up and down arrows. This way, you can avoid typing in long commands or filenames over again. You can edit the command on the command line, then press Enter again to issue it again
  • There is no Undo button in Unix! Once you have deleted a file, it's gone
  • / contains the mount point for the major filesystems
  • /bin contains the basic commands that are used by all users, such as cat, cp, ping, vi, su and ls
  • cd isn't in the /bin directory. cd is a special command that is built right into the kernal
  • /boot contains the files used by the boot loader, such as LILO, to boot the system
  • /dev contains the special files for different hardware devices.
  • /etc contains the system configuration files that are used by all users
  • /home contains home directories for all users
  • /lib contains the shared libraries that are needed to run the programs
  • /mnt contains the mount point for the external hard drives such as CD ROM, Floppy or Zip drives
  • /proc is a pseudo-file system, which is used as an interface to the kernal
  • /root is the home directory for the root user
  • /sbin contains special commands that are generally used only by root
  • /tmp is for temporary files
  • /usr contains all the commands, applications, documentation and libraries that are needed to operate the system. The files in /usr is meant to be shared by all users and are generally read-only. /usr is often the largest partition
  • /var contains files that regularly change. Log files and other temporary files such as mail and print spools, are usually kept in /var
  •  If you get and error called a segmentation fault, along with a crashed application, that means that the application tried to access a part of memory outside of its address space, so the kernal shit the application down before it could do damage. When this happens you should report bug to the maintainer of the application
  • bash is an acronym for Bourne-Again Shell, which is the traditional shell that was written by Stephen Bourne. All of the Bourne shell built-in commands are available in all versions of bash
  • There are three kinds of variables in bash and most of the other shells: User variables, Environment variables, Built-in variables
  • You can monitor your system on a frequent basis if you are running GNOME click on the mail menu, and select System, System Monitor. This is a wonderful graphical interface that will let you monitor what system processes are running and other useful information
Some useful commands:

cd             - change directory
ls              - list contents of directory
rm            - delete a file (no undelete!)
cp            -  copy a file
mv           - move a file
vi             - edit a file
cat           - dump contents of a file
more        - display file contents in paged format
find          - search file system for files/directories 
grep         - scan file(s) using pattern matching
man          - read/search a man page (try ’man man’)
mkdir       - create a directory
rmdir        - remove directory (’rm -r’ has the same effect)
pwd          - print current absolute working directory
cmp          - show differences between two files
lp             - print a file
df             - show disk usage
du            - show space used by directories/files
mail         - send an email message to another user
passwd    - change password 
clear        - clear the screen
exit         - close the prompt window
date        - display the date and time
free        - show memory usage
chmod   - set permissions on files or directories
top         - dymanically displays process status

No comments:

Post a Comment