All the rar files have the same 
password : http://learning4you.blogspot.com/
Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Sunday, August 3, 2008

UNIX COMMANDS - 2

Network Utilities

1. who

NAME
who - show who is logged on
SYNOPSIS
who [OPTION]... [ FILE | ARG1 ARG2 ]
DESCRIPTION
-a, --all
same as -b -d --login -p -r -t -T -u
-l, --login
print system login processes
2. w

NAME
w - Show who is logged on and what they are doing.

SYNOPSIS
w - [husfV] [user]

DESCRIPTION
w displays information about the users currently on the machine, and their processes.


3. finger

NAME
finger - user information lookup program

SYNOPSIS
finger [-lmsp] [user ...] [user@host ...]

DESCRIPTION
The finger displays information about the system users.

4. whoami

NAME
whoami - print effective userid

SYNOPSIS
whoami [OPTION]...

DESCRIPTION
Print the user name associated with the current effective user ID. Same as id -un.

--help display this help and exit
--version
output version information and exit

5. ftp

NAME
ftp - Internet file transfer program

SYNOPSIS
ftp [-pinegvd] [host]
pftp [-inegvd] [host]

DESCRIPTION
Ftp is the user interface to the Internet standard File Transfer Protocol.


6. telnet

NAME
telnet - user interface to the TELNET protocol

SYNOPSIS
telnet [-8EFKLacdfrx] [-X authtype] [-b hostalias] [-e escapechar] [-k realm] [-l user] [-n tracefile] [host [port]]

DESCRIPTION
The telnet command is used to communicate with another host using the TELNET protocol.


7. rlogin

NAME
rlogin - remote login

SYNOPSIS
rlogin [-8EKLdx] [-e char] [-l username] host

DESCRIPTION
Rlogin starts a terminal session on a remote host host.

Text Processing Utilities

1. cat

with redirection operators.
eg:
[prasad@localhost ~]$ cat prasad.txt > com.txt
[prasad@localhost ~]$ cat com.txt
prasad
prasad

2. head

NAME
head - output the first part of files

SYNOPSIS
head [OPTION]... [FILE]...

DESCRIPTION
Print the first 10 lines of each FILE to standard output.

-n, --lines=[-]N
print the first N lines instead of the first 10; with the leading ‘-’, print all but the last N lines of each file

-q, --quiet, --silent
never print headers giving file names

-v, --verbose
always print headers giving file names

3. tail

NAME
tail - output the last part of files

SYNOPSIS
tail [OPTION]... [FILE]...

DESCRIPTION
Print the last 10 lines of each FILE to standard output.

-q, --quiet, --silent
never output headers giving file names

-s, --sleep-interval=S
with -f, sleep for approximately S seconds (default 1.0) between iterations.

-v, --verbose
always output headers giving file names

4. uniq

NAME
uniq - report or omit repeated lines

SYNOPSIS
uniq [OPTION]... [INPUT [OUTPUT]]

DESCRIPTION
Discard all but one of successive identical lines from INPUT (or standard input), writing to OUTPUT (or standard output).

-i, --ignore-case
ignore differences in case when comparing

5. cut

NAME
cut - remove sections from each line of files

SYNOPSIS
cut [OPTION]... [FILE]...

DESCRIPTION
Print selected parts of lines from each FILE to standard output.

-b, --bytes=LIST
select only these bytes

-c, --characters=LIST
select only these characters

6.join

NAME
join - join lines of two files on a common field

SYNOPSIS
join [OPTION]... FILE1 FILE2

DESCRIPTION
For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delim-
ited by whitespace.

-e EMPTY
replace missing input fields with EMPTY

-i, --ignore-case
ignore differences in case when comparing fields

7. paste

NAME
paste - merge lines of files

SYNOPSIS
paste [OPTION]... [FILE]...

DESCRIPTION
Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.

-d, --delimiters=LIST
reuse characters from LIST instead of TABs

-s, --serial
paste one file at a time instead of in parallel

8. comm

NAME
comm - compare two sorted files line by line

SYNOPSIS
comm [OPTION]... FILE1 FILE2

DESCRIPTION
Compare sorted files FILE1 and FILE2 line by line.

-1 suppress lines unique to FILE1

-2 suppress lines unique to FILE2

-3 suppress lines that appear in both files

9. cmp

NAME
cmp - compare two files

SYNOPSIS
cmp [-l | -s] file1 file2 [skip1 [skip2]]

DESCRIPTION
The cmp utility compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files
are the same; if they differ, the byte and line number at which the first difference occurred is reported.

-l Print the byte number (decimal) and the differing byte values (octal) for each difference.

-s Print nothing for differing files; return exit status only.


10. nl

NAME
nl - number lines of files

SYNOPSIS
nl [OPTION]... [FILE]...

DESCRIPTION
Write each FILE to standard output, with line numbers added.

11. wc

NAME
wc - print newline, word, and byte counts for each file

SYNOPSIS
wc [OPTION]... [FILE]...
wc [OPTION]... --files0-from=F

DESCRIPTION
Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified.

-c, --bytes
print the byte counts

-l, --lines
print the newline counts

-w, --words
print the word counts

12. tr

NAME
tr - translate or delete characters

SYNOPSIS
tr [OPTION]... SET1 [SET2]

DESCRIPTION
Translate, squeeze, and/or delete characters from standard input, writing to standard output.

-c, -C, --complement
first complement SET1

-d, --delete
delete characters in SET1, do not translate

13. grep

NAME
grep, egrep, fgrep - print lines matching a pattern

SYNOPSIS
grep [options] PATTERN [FILE...]
grep [options] [-e PATTERN | -f FILE] [FILE...]

DESCRIPTION
Grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a
match to the given PATTERN. By default, grep prints the matching lines.

-a, --text
Process a binary file as if it were text; this is equivalent to the --binary-files=text option.

14. tee

NAME
tee
- read from standard input and write to standard output and files

SYNOPSIS
tee [OPTION]... [FILE]...

DESCRIPTION
Copy standard input to each FILE, and also to standard output.

-a, --append
append to the given FILEs, do not overwrite

-i, --ignore-interrupts
ignore interrupt signals

UNIX COMMANDS - 1

File Handling Utilities

mkdir

NAME
mkdir - make directories

SYNOPSIS
mkdir [OPTION] DIRECTORY...

DESCRIPTION
Create the DIRECTORY(ies), if they do not already exist.

-Z, --context=CONTEXT (SELinux) set security context to CONTEXT

-m, --mode=MODE
set file mode (as in chmod), not a=rwx - umask

-p, --parents
no error if existing, make parent directories as needed

-v, --verbose
print a message for each created directory

2. rmdir

NAME
rmdir - remove empty directories

SYNOPSIS
rmdir [OPTION]... DIRECTORY...

DESCRIPTION
Remove the DIRECTORY(ies), if they are empty.

-p, --parents
Remove DIRECTORY and its ancestors. E.g., ‘rmdir -p a/b/c’ is similar to ‘rmdir a/b/c a/b a’.

-v, --verbose
output a diagnostic for every directory processed

3. cd

NAME
cd - change the current directory
SYNOPSIS
cd [-L|-P] [dir]

DESCRIPTION
Changes the current directory.

4. ls


NAME
ls - list directory contents

SYNOPSIS
ls [OPTION]... [FILE]...

DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort.

-a, --all
do not ignore entries starting with .
-r, --reverse
reverse order while sorting
-R, --recursive
list subdirectories recursively
-l use a long listing format

5. touch

NAME
touch - change file timestamps

SYNOPSIS
touch [OPTION]... FILE...

DESCRIPTION
Update the access and modification times of each FILE to the current time.

-a change only the access time
-c, --no-create
do not create any files
-d, --date=STRING
parse STRING and use it instead of current time
-f (ignored)

6. pwd

NAME
pwd - print name of current/working directory

SYNOPSIS
pwd [OPTION]

DESCRIPTION
Print the full filename of the current working directory.




7. cp

NAME
cp - copy files and directories

SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

-i, --interactive
prompt before overwrite
-H follow command-line symbolic links
-l, --link
link files instead of copying

8. mv

NAME
mv - move (rename) files

SYNOPSIS
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

-f, --force
do not prompt before overwriting

-i, --interactive
prompt before overwrite

-v, --verbose
explain what is being done

9. ln

NAME
ln - make links between files
SYNOPSIS
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
DESCRIPTION
In the 1st form, create a link to TARGET with the name LINK_NAME. In the 2nd form, create a link to TARGET in the current directory.In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.

-i, --interactive
prompt whether to remove destinations
-s, --symbolic
make symbolic links instead of hard links

10. unlink

NAME
unlink - call the unlink function to remove the specified file

SYNOPSIS
unlink FILE
unlink OPTION

DESCRIPTION
Call the unlink function to remove the specified FILE.

11. cat

NAME
cat - concatenate files and print on the standard output

SYNOPSIS
cat [OPTION] [FILE]...

DESCRIPTION
Concatenate FILE(s), or standard input, to standard output.

-A, --show-all
equivalent to -vET
-n, --number
number all output lines
-s, --squeeze-blank
never more than one single blank line

12. more

NAME
more - file perusal filter for crt viewing
SYNOPSIS
more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file ...]

DESCRIPTION
More is a filter for paging through text one screenful at a time.

-p Do not scroll. Instead, clear the whole screen and then display the text.
-c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed.
-u Suppress underlining.

Disk Utilities

1. du

NAME
du - estimate file space usage

SYNOPSIS
du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F

DESCRIPTION
Summarize disk usage of each FILE, recursively for directories.

-a, --all
write counts for all files, not just directories
-b, --bytes
equivalent to ‘--apparent-size --block-size=1’
-c, --total
produce a grand total

2. df

NAME
df - report file system disk space usage

SYNOPSIS
df [OPTION]... [FILE]...

DESCRIPTION
df displays the amount of disk space available on the file system containing each
file name argument. If no file name is given, the space available on all currently mounted file systems is shown.

-a, --all
include dummy file systems

3. ulimit

NAME
ulimit - user limit

SYNOPSIS
ulimit [-SHacdefilmnpqrstuvx [limit]]

DESCRIPTION
Provides control over the resources available to the shell and to processes started by it, on systems that allow such control.


4. mount

NAME
mount - mount a file system

SYNOPSIS

mount [-lhV]
mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir

DESCRIPTION

All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out
over several devices. The mount command serves to attach the file system found on some device to the big file tree.

-V Output version.

-h Print a help message.

-v Verbose mode.

5. umount

NAME
umount - unmount file systems

SYNOPSIS
umount [-hV]
umount -a [-dflnrv] [-t vfstype] [-O options]
umount [-dflnrv] dir | device [...]

DESCRIPTION
The umount command detaches the file system(s) mentioned from the file hierarchy.

-V Print version and exit.
-h Print help message and exit.
-v Verbose mode.
Related Posts with Thumbnails