Under M$ windows, "dir".
Under *nix, "ls".
"ls -al" will list ALL files and subdirectories (even the hidden ones which start with a '.' in a long format which is easier to read and tells you more information about the files).
To list the subdirectories in the current directory: find . -maxdepth 1 -type d To list the subdirectories and all their subdirectories: find . -type d
The command in a terminal is: ls (short for List). This will list the files in the current directory. Whilst in the Home directory, to list the files in a different directory, for instance Videos, use: ls Videos.
DIR
In Linux: ls In Windows: dir
control+x+insert
ls will list the contents of a directory.
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.
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.
ATTRIB ....... Displays or changes file attributes. CD ........... Displays the name of or changes the current directory. CLS .......... Clears the screen. COPY ......... Copies one or more files to another location. DATE ......... Displays or sets the date. DEL .......... Deletes one or more files. DIR .......... Displays a list of files and subdirectories in a directory. DISKCOMP ..... Compares the contents of two floppy disks. DISKCOPY ..... Copies the contents of one floppy disk to another. EXIT ......... Quits the CMD.EXE program (command interpreter). FIND ......... Searches for a text string in a file or files. FINDSTR ...... Searches for strings in files. HELP ......... Provides Help information for Windows commands. MD ........... Creates a directory. MKDIR ........ Creates a directory. MORE ......... Displays output one screen at a time. MOVE ......... Moves one or more files from one directory to another directory. PATH ......... Displays or sets a search path for executable files. PRINT ........ Prints a text file. PROMPT ....... Changes the Windows command prompt. RD ........... Removes a directory. REN .......... Renames a file or files. RENAME ....... Renames a file or files. REPLACE ...... Replaces files. RMDIR ........ Removes a directory. SET .......... Displays, sets, or removes Windows environment variables. TIME ......... Displays or sets the system time. TREE ......... Graphically displays the directory structure of a drive or path. TYPE ......... Displays the contents of a text file. XCOPY ........ Copies files and directory trees. To see the full list use the "HELP" command at the DOS prompt.
Assuming you are looking for a specific file in a location, it's as simple as ls <name of file.> assuming you are in the directory you expect it to be in.
A directory list usually contains lists of information. An example of a physical directory list would be the Yellow Pages. For computers, a directory list would either be a list of files or a list of links to other files.
ls -la |grep "^d" |awk 'END {print "Number of directories: " NR}'