Sunday, August 25, 2013

Shell Programming : 4

Hello.. Friends , In this Basic tutorials i am going to explains some other commands like creating files & Directory & Removing or Deleting them.

  • cat
cat : concatenate files and print on the standard output
Syntax : cat [OPTION]... [FILE]...

cat commands is basically use to create a text file by the terminals.as we type cat  > filename & hit enter then it allows us to type anything you want in the file on the terminal and for saving this file we have to press ctrl+d . and if we want to read this file then we need to just change the operator from > to < .
to combine two files we just need to type cat file1 file2 > output 
we can create files by using touch  command too. this  is an empty file.

  • mkdir : make directories
Syntax : mkdir [OPTION]... DIRECTORY...
mkdir command is used to create a directory . we just need to type mkdir and directory name .



& if we want to remove these files & dir then we can use rm commands . 
  • rm : remove files or directories
if we just simply use rm filename then it remove just a file & if we want to remove the directory then we just need to type rm -r dirname .

i think it is important to discus these Basic topics before to start the scripting tutorials. Because the shell scripting is just a combinations of these all commands & if we Don't know about them then we can never move forwards. 

No comments:

Post a Comment