head

Tuesday, September 30, 2014

Unix Commands

                                                          Unix Commands


1)nohup scriptname & - Automatically runs the jobs in the background even after exit

2)disown -h jobID--runs the jobs even if you exit from the terminal
   disown -r  -deletes all the running jobs
   disown jobid -Removes specific running active job
   disown -a  --deletes or removes all the active jobs

3)exit or CTRL+D - exit from the terminal

4)ps aux           ... list the status of all jobs by process  identifier (PID)
   PS -A   --Process of All users
   PS -u Vivek --Process of  Single users

5) jobs -l -displays all the running and non running jobs

6)rm -rf foo/bar/baz-- removing the present directory
   rmdir name_of_directory--remove directories if empty
   rmdir -p foo/bar/baz--removing the present directory and its parent directories even if files exists
   rm filename - Contents are recoverble
   rm -Rf filename - Force remove -- contents are not recoverable

7)ls -l             ... list all files in the current working directory, along with each file's   permission, owner, size in bytes and date  of last modification.

8) ctrl  c           Abort the program currently running
    ctrl z           Suspend the program currently running (use  fg or bg to resume the program in the foreground or background, respectively)
 

9)KILL -15 <>--CLEANUP operations and Uses SIGTERM signal
 

10)KILL -9 <> -No CLEANUP operations and Uses SIGKILL signal
 

11)shred option filename -Overwriting the existing file multiple times and securely deleting the file

12)grep -a1 "fedora" sample.dat -- Print the serched line plus the above and below 1 lines
      grep -A1 "fedora" sample.dat-- Print the serched line plus above the serached pattern one line
      grep -B1 "fedora" sample.dat--Print the serched line plus  below the serached pattern one line

13)set number -sets the line number in the unix sh file.

14)ls -F --list filenames with a special character at the end that tells you what kind of file it is ("/" for directory, "*" for unix executable, "@" for alias/symlink, etc)

15) grep -n "search string" filename will display the serched string and the line number
For Ex:
1ABC
2ABC

16)Hard Link  -- ln filename pointerfilename--contains inode number of that file--Once deleted hardlink ,still the contents are visible
   New File is not created and the file is just a mirror of the original file. 
   Cannot be used across filesystems    ,Consumes extra space since new file
   with new inode number  is created.   
  
     Soft Link-- ln -s filename pointerfilename--contains  file name to reference the file--
    Once deleted softlink ,the contents are not visible
                            New File is not created and the file is just a mirror of the original file.
              Can be used across filesystems,does not consume extra space since new file with new inode number is not created.
http://www.maxi-pedia.com/difference+between+symbolic+link+and+hard+link

ls -il --To see the hard and soft links in the particular directory

ls -F--When Soft link is created , the filename ends with @symbol which can be seen and identified as softlink by using this command.

  



4 comments:

  1. ETL testing Online training is the process for extracting, transforming and loading
    large amount of data from a single database to another. There are numerous ways of doing it such as coding your own processes to the more often used way of implementing
    ETL tools continious the web site http://hyderabadsys.com/etl-testing-online-training/

    ReplyDelete
  2. thanks for giving information and it is very useful to new learnersEtl Testing Online Training

    ReplyDelete
  3. Explanation of shortcuts are awesome , would like to see more scenarios on etl testing thanks in advance

    etl testing online training

    ReplyDelete
  4. I just came across your Page and wanted to say that I’ve really enjoyed reading your posts.
    Hey Friends, I prepared my resume From this website & I finded More Samples Resumes From This Website
    I am Sharing Links With You
    ETL Testing Sample Resume

    ReplyDelete