Sunday, 7 October 2012

cat -- for creating and displaying short files | Unix Commands

cat

used to create, view and concatenate files.
To create a file named  file1
   % cat >file1
     line 1 
     line 2
<control-D> 
   %

<control-D>  tells the computer that what is typed is the content of the  file file1

To view a file we use cat in a different way:
   % cat file1
    line 1 
    line 2
%
To add text to an existing file 
   %  cat >file1
     line 3 
     line 4
<control-D> %
If we want to join 2 files named file1 and file 2 and create a new file named as file3
   % cat file1 file2 >file3
We could check the number of lines in the new file like this:
   % wc -l file3

Enhanced by Zemanta

Monday, 1 October 2012

ls - Basic Unix command

Here i am describing " ls "command which is one the basic Unix command
ls    --- used to list files in your system
ls -l --- used to list your files in 'long format', which contains information like size of the file,owner of the file,modified date,permissions etc.
ls -a --- used to list 'all files', including the ones whose filenames begin in a dot,that means hidden files also.

Welcome to Linux and Unix Commands

Warm welcome to a site about Linux and Unix commands.This site is for all Linux newbies and also for intermediate users who want to become more about linux. Learning basic commands is the first step in learning about linux.Here we discuss basic as well as advanced commands for different types of linux users.
Enhanced by Zemanta