Académique Documents
Professionnel Documents
Culture Documents
Cmp : Compares the content of 2 files and generates o/p into std. Output.
à Display the byte no. and line no. of the first position where the
files are different.
-l Displays, for each different, the byte no. in decimal and the differing bytes
in the octal.
The values of the return code are null for identical files,
else
fi
Comm : If you have files that are sorted and you want to compare them, use the comm. Command.
-can be used to either exclude or include the common lines between the two files.
-if you are interested only in finding out which lines are identical in file1 and file2,
flag
-b Ensure that more than one space on tab character is considered as one.
-c Line –
-c Line –
-D string – Create a merged version of the first and second files on the standard output
-e Generate output that can be input to ed to produce the second file from the first file
-r Execute this command on all identically named subdirectory of the specified directory.
diff3:
flag
-3 produce an edit script that contains only lines containing the differences from the
third file
-E , -X –
-e –
-x –
dir cmp :
-à this commant compares the names of the files in each directory and generates a list
of filename that exits in only one of the directories followed by filenames that exist
in both and whether they are identical or not .
flag :
-d -à generate a list of files that exist in either of the directories followed by a list of .
files that exist in both directories.
-s -à generates a list of files that exist in eighter of the directories followed by a list of
Compares 2 files and display o/p on the std o/p in a side-by-side format.
Details of o/p :
-à if the w lines are identical the command displays each line of the 2 files with a series
-à if the line exists in only the first file , a < is displayed at the end of the line.
-à if the line exists in only the second file, a < is displayed at the beginning of the file.
àif the lines from the two files are different , a | is displayed between the lines.
Flags :
-l à display onlu the line from the first file if ht lines from the two files are identical.
-o file à create a marged file from the first and second file depending on a no of
Touch :
If a file does not exist this command creates it (if u have write access to the directory.
à if a file is already present this command modifies the last modifications time of the
file.
Chmod :
U may have to modify the permission of a firectory or files to either secure then or to make
them accessible to others .
à if u want to rewoke the read permission other then è chmod o-r test file.
Chgrp :
If u want to change the group to which the file belongs use the chgrp command.
Ex è To change the owner of testfiel from staff to devp chgrp newgroup testfilename.
Chown :-
Note :- à on unix systems only the root user can change the owner of a file or directory.
Rm :
Flag :
does not generate any messages the case in which a file does not
Mv :
To rename a file and to move from one directory to another refaining the origined file name
( save as copy )
Flages :
Cp :
Can be used to make a copy of the contents of one or more source files as sypecified target
files if target files already exists it is overwritten with the contents of the cource file.
Flag :
-p à retain the modification date & time as will as permission modes of the source file
-I à interactive mode
Cat :
Cp command allows u to copy one files into another files it does not allow u to copy multiple
files into the sanefile
à to coneatemultiple files into a single files into a single file use the cat command
-b à eliminate line nos., from blank lines when used with the –n flag.
-q à suppress messages if the cat command can not find one or more of the input files.
-e à display a $ at the end of each line, when specified with the –v flage.
Rcp :-
Instead of local,
If y want to copy files from one host to another u can use the rcp command to copy files
between the same or different hosts.
If neither thesance non the target file specifies the host name the rcp can behaves the same carry as
the cp command.
Flag :
-p à date
-r à recuersevely