Wednesday, 24 August 2016

Unix Shell Scripting (day 2)

Shell Scripting:
Command for                                                              command
1.creating text file with some text                               cat  >  text_file_name
Note:To end the above created text document press ctrl+d on ur key board.
2.To view the content of the text file                           cat  <  text_file_name
3.To merge the content of 2 different
      files into another file                                              cat  file_name_1 file_name_2  >  file_name_3
4.renaming a file                                                          mv  Old_file_name  New_file_name
5.removing a file                                                          rm  file_name
6.removing a directory                                                 rm -r  directory_name
7.removing a directory                                                 rmdir  directory_name
8.to copy a existing file from one place to another      cp  file_name1  folder_name/file_name2
Note: Copying a "file name1" existed in home folder into a folder_name "music"  with name "file name2" 
9.to create a link between two files(replica)                ln file_name_1  file_name_2
Note:In 9th command whatever the changes made in file_name_1 it reflected in file_name_2
10.to create a soft link for the hard link                       ln  -s  file1  file2
 Note :In 10nth command file1 is hard link and file2 is soft link. it will not reflect anything to hard     
           link  when we remove the soft link. If we remove the hard link then soft link will not open since hard link of it was not exist.

No comments:

Post a Comment

If you Like my blog Spread it and help friends for whom this blog is useful for their career.