Friday 21 June 2013

All Linux/Unix Commands.



UNIX / Linux Command Summary

Some of the available options are :
Cat [-options] filename(S)
-s silent about files that
cannot be accessed
-v enables display of non printinging characters (except tabs, new lines, form-

feeds)
-t when used with –v, it causes tabs to be printed as ^I’s
-e when used with –v, it causes $ to be printed at the end of each line
The –t and –e options are ignored if the –v options is not specified.

cd
Used to change directories

chgrp
Changes the group that owns a file.
Chgrp [grou –id] [filename]

chmod
Allows file permissions to be changed for each user. File permissions can be changed only by the owner (s).
Chmod [+/-][rwx] [ugo] [filename]

chown
Used to change the owner of a file.
The command takes a file(s) as source files and the login id of another user as the target.
Chown [user-id] [filename]

cmp
The cmp command compares two files (text or binary) byte-by-byte and displays the first occurrence where the files differ.
Cmp [filename1] [filename2] -1 gives a long listing

comm.
The comm command compares two sorted files and displays the instances that are common. The display is separated into 3 columns.
Comm. filename1 filename2
first displays what occurs in first files but not in the second
second displays what occurs in second file but not in first
third displays what is common in both files

continue statement
The rest of the commands in the loop are ignored. It moves out of the loop and moves on the next cycle.

cp
The cp (copy) command is used to copy a file.
Cp [filename1] [filename2]

cpio(copy input/output)

Utility program used to take backups.
Cpio operates in three modes:
-o output
-i input
-p pass

creat()
the system call creates a new file or prepares to rewrite an existing file. The file pointer is set to the beginning of file.
#include<sys/tyes.h>
#include<sys/stat.h>
int creat(path, mode)

char *path;
int mode;

cut
used to cut out parts of a file. It takes filenames as command line arguments or input from standard input. The command can cut columns as well as fields in a file. It however does not delete the selected parts of the file.
Cut [-ef] [column/fie,d] filename
Cut-d “:” –f1,2,3 filename
Where –d indicates a delimiter specified within “:”

df
used to find the number of free blocks available for all the mounted file systems.
#/etc/df [filesystem]

diff
the diff command compares text files. It gives an index of all the lines that differ in the two files along with the line numbers. It also displays what needs to be changed.
Diff filename1 filename2

echo
The echo command echoes arguments on the command line.
echo [arguments]

No comments:

Post a Comment