Commands and Tools in Linux and Windows

Commands:

date Display or set the date of the system

time Display or set the time of the system

ver Display the MS-DOS version that is being used

dir Display the list of subdirectories and files of a directory

cls Clear the screen

mkdir,md directoryMake a directory with the name “directory”

Example: md mytools

chdir, cd directory Display the name or change the current directory to “directory”

Example: cd mytools

rmdir, rd directory Delete the directory with the name “directory”

Example: rd mytools

tree directory Display the structure of folders of a path in text-graphic format

Example: tree c:\mytools

e.g.you can check tree for windows folder

chkdsk Check a disk and show a status report (File System NTFS/FAT)

chkdsk Displays:

Total Diskspace

Number of files on Disk

Number of Indexes

BadSectors on Disk

Bytes in use by System

Space occupied by LOG files

Space available on Disk

Check Disk scans for errors and can automatically repair them. Just be patient because this process can take at least 15 to 20 minutes or longer if a lot of damage needs to be fixed. Even without any obvious signs, it still might be a good idea to use this feature just to be on the safe side.

Here are the step-by-step instructions:

Click "Start"

Click "Run..."

Where it says "Open:" type the following: cmd

Click "OK"

You will see a black screen with a blinking cursor. This is the command prompt. Use it to type the

following command: chkdsk /r /f


Then press "Enter". If you Have done this correctly, you should see this:


C:\Documents and Settings\User>chkdsk /r /f

The type of the file system is NTFS.

Cannot lock current drive.


Chkdsk cannot run because the volume is in use by another

process. Would you like to schedule this volume to be

checked the next time the system restarts? (Y/N)

Type Y where it says (Y/N) to answer yes to the question. Reboot your computer and your hard drive will be scanned for errors before Windows loads. Be patient as this can take 15 to 20 minutes, even up to 60 minutes if there are a lot of files with bad clusters which need to be replaced.

mem Show the amount of memory used and free in the system

rename,ren source dest Change the name of files

Example: ren oldname newname

copy source dest Copy one or more files to another location

Example: copy c:\mytools\myfile.txt c:\tmp

move source dest Move files and change the name of files and directories

Example: move c:\mytools c:\tmp

type file Type the content of one or more text files

Example: type c:\mytools\myfile.txt

more file Display the information screen by screen

Example: more c:\mytools\myfile.txt

delete, del file Delete one or more files

Example: del c:\mytools\myfile.txt

Note: The words in italics are not commands, and must be replaced by the desired

values. Some of the commands can be used by typing either their long version or short

version; for example, "delete" and "del‚" are the same command.

Tools:

ping host Verify contact with the machine “host”

The command ping sends "packets" using ICMP (Internet Control

Message Protocol) to another computer, to learn whether it is

accessible through the network. In addition, it shows a statistical

summary about the percentage of packets that have not been

answered and the response time. The name of the machine can

be used directly or its IP address.

Examples: ping www.google.com

ping 193.145.85.2

Some options are:

- n N: send N packets

- t: ping the specified host until stopped (press CTRL+C to end)

To see more options: ping /h

tracert host Show the route that packets follow to reach the machine “host”

The command tracert is the abbreviation of trace route, which

allows you to learn the route that a packet follows from the origin,

(your machine) to the destination machine. It can also tell you

the time it takes to make each jump. At the most, 30 jumps will be

listed. It is sometimes interesting to observe the names of the

machines through which the packets travel.

Examples: tracert www.google.com

tracert 193.145.85.2

Some options are:

- h N: to specify N, at the most, jumps.

- d: to not show the names of the machines.

To see more options: tracert

ipconfig Display information on the active interfaces (ethernet, ppp, etc.)

in the computer.

Some options:

/all: to show more details

/renew name: renews connection with “name” when automatic

configuration with DHCP is used.

/release name: deactivates all matching connections when

automatic configuration with DHCP is used.

To see more options: ipconfig /?

route print Display the routing table

The command route serves to define static routes, to erase routes

or simply to see the state of the routes.

Some options:

print: to show the list of routes.

delete: to delete a route.

add: to add a route.

To see more options: route/?

netstat Displays information on the status of the network and established

connections with remote machines.

Some options:

-a: To sample all the connections and listening ports

-n: to display addresses and port numbers in numeric form

-e: to sample Ethernet statistics

For example: netstat - an

To see more options: netstat/?

For additional information on these commands and tools type "command /h" or

"command /?‚" or "help command" from a MS-DOS window.

For example, for additional information on the tool netstat, we have three possibilities:

1) netstat /h

2) netstat /?

3) help netstat

0 comments:

Post a Comment