Monday, 24 December 2012

Saturday, 3 November 2012

25 Basic Unix Commands you need to know | Best Unix Commands


  • Here is a simple description about the basic Unix commands a Unix learner must know.25 Unix commands are described with example.After reading all these you will get the basic idea to work on Unix.

  • rsh  -  remote shell
  • wc  - count characters, words, lines
  • telnet - log in to another machine
  • tar  - to c reate an archive, add or extract files
  • tail  - to view end of a file
  • sort  - to sort content of a directory
  • rmdir  - to remove a directory
  • rm  - to remove a file
  • pwd   find out what directory you are in
  • print  -  custom print command
  • ncftp  connecting to remote machine as anonymous
  • mv  -  for moving and renaming files
  • more - to read a file
  • mkdir - to make a directory
  • lpr  -  standard print command
  • ls -  see file list in a directory
  • head  to display first part of a file
  • grep  - to search content in a file
  • ftp- connect to a remote machine to download or upload files
  • echo - echo arguments in a command
  • date - for displaying date and time
  • cp = for copying files
  • cd and cd..- change directory
  • chmod - change permissions
  • cat- for creating and displaying short files

rsh - Basic Unix Commands


rsh

Use this command if you want to work on a computer different from the one you are currently working on. One reason to do this is that the remote machine might be faster. For example, the command
   % rsh freedom
connects you to the machine freedom

wc - Basic Unix Commands


wc

Use this command to count the number of characters, words, and lines in a file. Suppose, for example, that we have a file colors with contents
   red cloth
   green grass
   black sea
   white elephant
   blue whale
   yellow paper
Then we can do this
   % wc colors
     6      12      60 tmp
This shows that dict has 6 lines, 12 words, and 60 characters.

to view number of lines only
 % wc -l colors
     6 tmp
to view number of  words only
 % wc -l colors
     12 tmp
to view number of  characters only
 % wc -l colors
     60 tmp     

telnet - Basic Unix Commands


telnet

Use this command to log in to another machine from the machine you are currently working on. For example, to log in to the machine "freedom", do this:
   % telnet freedom

tar - Basic Unix Commands


tar

To create compressed archives of directories and files, and also to extract directories and files from an archive. Example:
   % tar -tvzf essay.tar.gz
displays the file names in the compressed archive essay.tar.gz while
   % tar -xvzf essay.tar.gz
extracts the files from essay.tar.gz.

tail - Basic Unix Commands


tail

Use this command to look at the tail of a file. For example,
   % tail poem1
displays the last 10 lines of the file poem1 To see a specific number of lines, do this:
   % tail -n 20 poem1
This displays the last 20 lines of the poem.


head - Basic Unix Commands