Be Inquisitive ! Be Curious !! Explore !!! Enjoy !!!!

Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Linux fdisk command

| Monday, August 15


About fdisk
Partition table manipulator for Linux.
Syntax
fdisk [-u] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device

fdisk -l [-u] [device ...]

fdisk -s partition ...

fdisk -v
-b sectorsizeSpecify the sector size of the disk. Valid values are 512, 1024, or 2048. (Recent kernels know the sector size. Use this only on old kernels or to override the kernelâs
ideas.)
-C cylsSpecify the number of cylinders of the disk. I have no idea why anybody would want to do so.
-H headsSpecify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
-S sectsSpecify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
-lList the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if that exists) are used.
-uWhen listing partition tables, give sizes in sectors instead of cylinders.
-s partitionThe size of the partition (in blocks) is printed on the standard output.
-vPrint version number of fdisk program and exit.
Examples
Tip You most have root access for this command to work.
fdisk -l
List the partition information of the computer you're logged into. Below is an example of what this output may look like.
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 191 1534176 83 Linux
/dev/sda2 192 2231 16386300 83 Linux
/dev/sda3 2232 3506 10241437+ 83 Linux
/dev/sda4 3507 30401 216034087+ 5 Extended
/dev/sda5 3507 3767 2096451 82 Linux swap / Solaris
/dev/sda6 3768 3832 522081 83 Linux
/dev/sda7 3833 30401 213415461 83 Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30401 244196001 83 Linux
Warning The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in
the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra
information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.

The bottom line is that if you use fdisk to change the size of a DOS partition table entry, then you must also use dd to zero the first 512 bytes of that partition before using
DOS FORMAT to format the partition. For example, if you were using disk to make a DOS partition table entry for /dev/sda1, then (after exiting fdisk and rebooting Linux so that
the partition table information is valid) you would use the command "dd if=/dev/zero of=/dev/sda1 bs=512 count=1" to zero the first 512 bytes of the partition.

BE EXTREMELY CAREFUL if you use the dd command, since a small typo can make all of the data on your disk useless.

For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with
the Linux fdisk program.
Read more...

Deleting files in MS-DOS without a prompt.

|


Issue

Deleting files in MS-DOS without a prompt.

Cause

To help prevent files from becoming accidentally deleted Microsoft will warn you before deleting files or folders.

Solution

By default Microsoft Windows will not prompt a user or give a user a prompt or warning when deleting files on a computer using the del command. However, when attempting to delete a directory using the deltree or rmdir command on a directory that is not empty you will receive a warning or error message about deleting the directory.
To suppress the prompting use the deltree command and add the tag /y.  Here is an example of how the whole command would look, deltree c:\windows\temp\*.* /y However, this does not work in all versions of Windows and MS-DOS.
If this command does not work we would recommend that you create a batch file with the below command in the batch file.
echo y | del %1\*.*
Once created, you can type the name of the batch file then the name of the directory that you wish to delete.
Microsoft Windows 2000 and Windows XP users
Users who wish to delete a directory containing files in a MS-DOS session running under Microsoft Windows 2000 or Windows XP can also use the rmdir or rd command with the /S option.
Remember that when you delete files or directories from the computer they are permanently removed, so be careful! Microsoft Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, and later versions of Windows users deleting files through MS-DOS should realize that all deleted files will not be sent to the recycle bin.
Other users using MS-DOS through Windows
Users running MS-DOS through later versions of Microsoft Windows can also utilize the erase command to delete files without a prompt. Microsoft Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, and later versions of Windows users deleting files through MS-DOS should realize that all deleted files will not be sent to the recycle bin.
Read more...

List of Command Prompt Commands

| Tuesday, August 9


The Command Prompt in Windows provides access to over 270 commands! These commands are used to do certain operating system tasks from a command line interfaceinstead of the graphical Windows interface we use most of the time.
Note: It's important to know that the commands in Windows 7, Vista, and XP are calledCMD commands or Command Prompt commands and the commands in Windows 98/95 and MS-DOS are called DOS commands. I've included all of them in this list to help show changes in commands from operating system to operating system.
If you're only interested in the commands available in your version of Windows or MS-DOS, I do keep accurate and detailed lists per operating system:
Below is a complete list of Command Prompt commands, often called CMD commands or Command Prompt codes, available from the Command Prompt in Windows 7, Vista, and XP. As I mentioned above, I've also included DOS commands from MS-DOS and Windows 98/95:
I also have a table of these commands if you're not interested in the descriptions.
append - getmac | goto - rem | ren - xcopy

Append

The append command can be used by programs to open files in another directory as if they were located in the current directory.
The append command is available in MS-DOS as well as in all 32-bit versions of Windows. The append command is not available in 64-bit versions of Windows.

Arp

The arp command is used to display or change entries in the ARP cache.
The arp command is available in all versions of Windows.

Assoc

The assoc command is used to display or change the file type associated with a particular file extension.
The assoc command is available in Windows 7, Windows Vista, and Windows XP.

At

The at command is used to schedule commands and other programs to run at a specific date and time.
The at command is available in Windows 7, Windows Vista, and Windows XP.

Atmadm

The atmadm command is used to display information related to asynchronous transfer mode (ATM) connections on the system.
The atmadm command is available in Windows XP.
Support for ATM was removed beginning in Windows Vista, making the atmadm command unnecessary.

Attrib

The attrib command is used to change the attributes of a single file or a directory.
The attrib command is available in all versions of Windows, as well as in MS-DOS.

Auditpol

The auditpol command is used to display or change audit policies.
The auditpol command is available in Windows 7 and Windows Vista.

Bcdboot

The bcdboot command is used to copy boot files to the system partition and to create a new system BCD store.
The bcdboot command is available in Windows 7.

Bcdedit

The bcdedit command is used to view or make changes to Boot Configuration Data.
The bcdedit command is available in Windows 7 and Windows Vista.
The bcdedit command replaced the bootcfg command beginning in Windows Vista.

Bdehdcfg

The bdehdcfg command is used to prepare a hard drive for BitLocker Drive Encryption.
The bdehdcfg command is available in Windows 7.

Bitsadmin

The bitsadmin command is used to create, manage, and monitor download and upload jobs.
The bitsadmin command is available in Windows 7 and Windows Vista.
The bitsadmin command is available in Windows 7 but is being phased out. The BITS PowerShell cmdlets should be used instead.

Bootcfg

The bootcfg command is used to build, modify, or view the contents of the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located.
The bootcfg command is available in Windows 7, Windows Vista, and Windows XP.
The bootcfg command was replaced by the bcdedit command beginning in Windows Vista. Bootcfg is still available in Windows Vista and Windows 7 but it serves no real value since boot.ini is not used in these operating systems.

Break

The break command sets or clears extended CTRL+C checking on DOS systems.
The break command is available in all versions of Windows, as well as in MS-DOS.
The break command is available in Windows XP and later versions of Windows to provide compatibility with MS-DOS files but it has no effect in Windows itself.

Cacls

The cacls command is used to display or change access control lists of files.
The cacls command is available in Windows 7, Windows Vista, and Windows XP.
The cacls command is being phased out in favor of the icacls command, which should be used instead in Windows 7 and Windows Vista.

Call

The call command is used to run a script or batch program from within another script or batch program.
The call command is available in all versions of Windows, as well as in MS-DOS.
The call command has no effect outside of a script or batch file. In other words, running the call command at the Command Prompt or MS-DOS prompt will do nothing.

Cd

The cd command is the shorthand version of the chdir command.
The cd command is available in all versions of Windows, as well as in MS-DOS.

Certreq

The certreq command is used to perform various certification authority (CA) certificate functions.
The certreq command is available in Windows 7 and Windows Vista.

Certutil

The certutil command is used to dump and display certification authority (CA) configuration information in addition to other CA functions.
The certutil command is available in Windows 7 and Windows Vista.

Change

The change command changes various terminal server settings like install modes, COM port mappings, and logons.
The change command is available in Windows 7 and Windows Vista.

Chcp

The chcp command displays or configures the active code page number.
The chcp command is available in all versions of Windows, as well as in MS-DOS.

Chdir

The chdir command is used to display the drive letter and folder that you are currently in. Chdir can also be used to change the drive and/or directory that you want to work in.
The chdir command is available in all versions of Windows, as well as in MS-DOS.

Chglogon

The chglogon command enables, disables, or drains terminal server session logins.
The chglogon command is available in Windows 7 and Windows Vista.
Executing the chglogon command is the same as executing change logon.

Chgport

The chgport command can be used to display or change COM port mappings for DOS compatibility.
The chgport command is available in Windows 7 and Windows Vista.
Executing the chgport command is the same as executing change port.

Chgusr

The chgusr command is used to change the install mode for the terminal server.
The chgusr command is available in Windows 7 and Windows Vista.
Executing the chgusr command is the same as executing change user.

Chkdsk

The chkdsk command, often referred to as check disk, is used to identify and correct certain hard drive errors.
The chkdsk command is available in all versions of Windows, as well as in MS-DOS.

Chkntfs

The chkntfs command is used to configure or display the checking of the disk drive during the Windows boot process.
The chkntfs command is available in Windows 7, Windows Vista, and Windows XP.

Choice

The choice command is used within a script or batch program to provide a list of choices and return the value of that choice to the program.
The choice command is available in MS-DOS and all versions of Windows except Windows XP.
Use the set command with the /p switch in place of the choice command in batch files and scripts that you plan to use in Windows XP.

Cipher

The cipher command shows or changes the encryption status of files and folders on NTFS partitions.
The cipher command is available in Windows 7, Windows Vista, and Windows XP.

Clip

The clip command is used to redirect the output from any command to the clipboard in Windows.
The clip command is available in Windows 7 and Windows Vista.

Cls

The cls command clears the screen of all previously entered commands and other text.
The cls command is available in all versions of Windows, as well as in MS-DOS.

Cmd

The cmd command starts a new instance of the cmd.exe command interpreter.
The cmd command is available in Windows 7, Windows Vista, and Windows XP.

Cmdkey

The cmdkey command is used to show, create, and remove stored user names and passwords.
The cmdkey command is available in Windows 7 and Windows Vista.

Cmstp

The cmstp command installs or uninstalls a Connection Manager service profile.
The cmstp command is available in Windows 7, Windows Vista, and Windows XP.

Color

The color command is used to change the colors of the text and background within the Command Prompt window.
The color command is available in Windows 7, Windows Vista, and Windows XP.

Command

The command command starts a new instance of the command.com command interpreter.
The command command is available in MS-DOS as well as in all 32-bit versions of Windows. The command command is not available in 64-bit versions of Windows.

Comp

The comp command is used to compare the contents of two files or sets of files.
The comp command is available in Windows 7, Windows Vista, and Windows XP.

Compact

The compact command is used to show or change the compression state of files and directories on NTFS partitions.
The compact command is available in Windows 7, Windows Vista, and Windows XP.

Convert

The convert command is used to convert FAT or FAT32 formatted volumes to the NTFS format.
The convert command is available in Windows 7, Windows Vista, and Windows XP.

Copy

The copy command does simply that - it copies one or more files from one location to another.
The copy command is available in all versions of Windows, as well as in MS-DOS.
The xcopy command is considered to be a more "powerful" version of the copy command.

Cscript

The cscript command is used to execute scripts via Microsoft Script Host.
The cscript command is available in all versions of Windows.
The cscript command is most popularly used to manage printers from the command line using scripts like prncnfg, prndrvr, prnmngr, and others.

Ctty

The ctty command is used to change the default input and output devices for the system.
The ctty command is available in Windows 98 and 95 as well as in MS-DOS.
The functions provided by the ctty command were no longer necessary beginning in Windows XP because the command.com interpreter (MS-DOS) is no longer the default command line interpreter.

Date

The date command is used to show or change the current date.
The date command is available in all versions of Windows, as well as in MS-DOS.

Dblspace

The dblspace command is used to create or configure DoubleSpace compressed drives.
The dblspace command is available in Windows 98 and 95, as well as in MS-DOS.
DriveSpace, executed using the drvspace command, is an updated version of DoubleSpace. Windows natively handles compression beginning in Windows XP.

Debug

The debug command starts Debug, a command line application used to test and edit programs.
The debug command is available in MS-DOS as well as in all 32-bit versions of Windows. The debug command is not available in 64-bit versions of Windows.

Defrag

The defrag command is used to defragment a drive you specify. The defrag command is the command line version of Microsoft's Disk Defragmenter.
The defrag command is available in all versions of Windows, as well as in MS-DOS.

Del

The del command is used to delete one or more files.
The del command is available in all versions of Windows, as well as in MS-DOS.
The del command is the same as the erase command.

Deltree

The deltree command is used to delete a directory and all the files and subdirectories within it.
The deltree command is available in Windows 98 and 95, as well as in MS-DOS.
Beginning in Windows XP, a folder and its files and subfolders can be removed using the /s function of the rmdir command. Deltree was no longer needed with this new rmdir ability so the command was removed.

Diantz

The diantz command is used to losslessly compress one or more files. The diantz command is sometimes called Cabinet Maker.
The diantz command is available in Windows 7, Windows Vista, and Windows XP.
The diantz command is the same as the makecab command.

Dir

The dir command is used to display a list of files and folders contained inside the folder that you are currently working in. The dir command also displays other important information like the hard drive's serial number, the total number of files listed, their combined size, the total amount of free space left on the drive, and more.
The dir command is available in all versions of Windows, as well as in MS-DOS.

Diskcomp

The diskcomp command is used to compare the contents of two floppy disks.
The diskcomp command is available in all versions of Windows, as well as in MS-DOS.
Read more...