answersLogoWhite

0


Best Answer

dir

Lists all files and directories in the directory that you are currently in.

dir /ad

List only the directories in the current directory. If you need to move into one of the directories listed use the CD command.

dir /s

Lists the files in the directory that you are in and all sub directories after that directory, if you are at root "C:\>" and type this command this will list to you every file and directory on the C: drive of the computer.

dir /p

If the directory has a lot of files and you cannot read all the files as they scroll by, you can use this command and it will display all files one page at a time.

dir /w

If you don't need the info on the date / time and other information on the files, you can use this command to list just the files and directories going horizontally, taking as little as space needed.

dir /s /w /p

This would list all the files and directories in the current directory and the sub directories after that, in wide format and one page at a time.

dir /on

List the files in alphabetical order by the names of the files.

dir /o-n

List the files in reverse alphabetical order by the names of the files.

dir \ /s |find "i" |more

A nice command to list all directories on the hard drive, one screen page at a time, and see the number of files in each directory and the amount of space each occupies.

dir > myfile.txt

Takes the output of dir and re-routes it to the file myfile.txt instead of outputting it to the screen.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

C> dir /o (plus some type of sort order)

Sort order:

N By name (alphabetic)

S By size (smallest first)

E By extension (alphabetic)

D By date & time (earliest first)

G Group directories first

- Prefix to reverse order

A By Last Access Date (earliest first)

So seeing the command: C> dir /on

will list the files in alphabetical order by the names of the files.

For a list of various other MS-DOS commands, check out: http://www.computerhope.com/msdos.htm#02

Hope this helps!

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

The dir command (short for directory) list files in MS-DOS. This command should not be confused with the lscommand, which lists files in Linux, Unix, and each of its variants.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In ms dos which command can sort files in a directory list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What commands will list the files in the working directory in their reverse alphabetical order?

ls | sort -r Use ls command to list all files, in the present directory. Then pipe '|' the output of the ls command to sort -r. The -r option will reverse the sort.


List and execute UNIX command to display the sizes of the six largest files in the current directory listed in ascending order of their size?

There are several ways to do this (typical Unix ...). you could execute the following command: du | sort -n | tail -6 The 'du' command lists disk usage by listing a file name and size per line, then use the sort command to list numerically, and the last 6 will be the 6 largest.


Write a shell script to sort all the files in the current directory in an alphabetical order and direct the sorted list to a new file?

The following simple shell command lists the contents of a directory (verbose), and redirects the output to 'newfile.txt': ls -l > newfile.txt See related links.


What is ls -latr?

ls list directory content-l long format, displaying Unix file types, permissions, number of hard links, owner, group, size, date, and file name-a lists all files in the given directory, which names begins with .-r Reverse the order of the sort.-t sort the list of files by modification time.This lists the most recently modified files at the end of the listing. ls -latr is a convenient way to see what has changed recently in a directory.


Unix list command with a time sort?

The one I use most often is: ls -lt This sorts the files by most recent date first.


How can you tell whether a given file is a directory and how can you list all files in a directory including subfolders?

== == In a programming context, one usually determines whether a file is a directory using functions that access file metadata. These are dependent on the system you are programming and what language you are programming in. You should consult a reliable reference for the programming language, such as the manpages for C and C++ (in Unix-like systems) or Java's Javadocs (available on the web). To list all files in a directory, a programmer will usually iterate across all members of the directory and print some form of information found in the file metadata, such as the filename. ---- A parent directory is the directory containing the current directory. A child directory is a directory inside of the current directory. A subdirectory is a directory inside of the current directory or any its child directories. ---- In Windows, the most common way to determine if a file is a directory is using the GUI. To do this, right-click the file icon and click "Properites". If it is a directory, then the type of the file should be listed as "File Folder". Alternately, you can use the Command Prompt, which by default (Windows XP) can be accessed via the Start menu, in the Applications folder. Alternately, type "cmd" into the Run prompt (or the search field in Vista). You will be presented with a command line interface. Use the command "CD" followed by a file path to change to the desired directory, then type "DIR /A:D". This will list all files in the current directory with the attribute "directory". Alternately, you can include a path to the DIR command, such as "DIR /A:D C:\WINDOWS", to display the contents of the directory in the path. To list all files in subfolders, use the command "DIR /S". The /S flag will cause subdirectories to be printed as well. Usage of "ls" is explained in full in the manpages, try invoking "man ls" on your system for more information. In Windows systems using the NTFS filesystem, drives are mounted as separate entities and the root folder of a drive is the drive letter, followed by a colon and a backslash (i.e. "C:"). ---- In Unix-like systems, the most common utility is the command "ls". Remember that such systems are case-sensitive, so capitalization matters. To use it, open up a shell emulator, such as bash or csh, and type "cd" followed by a path to change to that directory (or include a desired path to the subsequent commands). Type "ls" to see a listing of all files in the current directory, or "ls /bin" to see a listing of all files in the directory "/bin". By adding in the arguments "l" and "a", as in the command "ls -la", you can additionally see the file permissions (starting with a 'd' if they are a directory), and the "." and ".." directories, respectively. To display the files in all subdirectories, add the argument 'R' to your list of arguments (or just do "ls -R" if you don't require more extensive information). Usage of "ls" is explained in full in the manpages, try invoking "man ls" on your system for more information. If you are using the bash shell, you can use pipes ('|') to chain together several programs to do such things as search or sort your results from the previous program. For example, "ls -l | grep foo" would first list the contents of the current directory (ls), then search through them and print out only those containing the string "foo" (grep). In most of these systems, storage devices are mounted to mountpoints, which are treated as directories within the system's directory tree. The root directory is "/". Every directory has a link to itself (".") and a link to the parent directory (".."). The root directory is special in that ".." also links back to the root directory.


Program to sort files in directory?

What are you trying to sort? Are you trying to consolidate or organize? To organize your files try using Dr Utilz or FileSieve 3.0 to sort through your directories and organize them as you see fit. http://www.snapfiles.com/get/FileSieve.html


How do you find the largest file in Unix?

There is no simple command available to find out the largest files/directories on a Linux/UNIX/BSD filesystem you can easily find out list of largest files/directoris: du -a /var | sort -n -r | head -n 1


What are some commands that are used in the command prompt?

Enter 'HELP' at the command prompt for a complete list. Enter 'HELP command' or 'command /?' to display help information on that command. E.g., 'HELP ATTRIB' or 'ATTRIB /?' to display help on the ATTRIB command.


Which Linux command can you use to display a file in alphabetical order?

Generally the default behavior of the 'ls' command will list them in alpha order.


What is a filter in Unix?

A Unix filter is a command pattern that allows the output of one command to be "piped" into the input of the next command. Commands like 'ls' which list a directory are not filters since they only generate output. Filter examples are grep, sed, sort, uniq, awk. Commands in Unix are usually filters unless they only create output, like 'ls', 'vi', etc.


What are Ordinary UNIX computer Files?

There are several types of files found on Unix: Device files (represent physical hardware devices) directory files ( "folders" ) fifo or named pipes ( a sort of communication mechanism between two or more programs) symbolic links (think "shortcuts" ) and finally, ordinary files (your txt files, jpg images, videos, mp3's etc.)