answersLogoWhite

0


Best Answer

for i in *

do

if [ -d $i ]; then

echo $i directory >> /tmp/directories

fi

done

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Shell programming to list all directory files to a directory?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the command to be used to see all the files in a directory?

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.


What types of information do directory lists generally contain?

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.


What kind of file does not appear in the directory list?

Folder or files which start with . will not not be appear in directory list Amit Gupta


What is a list of available programs and files on a computer disk?

This is usually called the directory or directory listing.


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.


Write a shell script to display the smallest file name in respect of the string length among the list of files available in the current directory?

ls-lS | tail-1


What is the command to list all files and sub directories in a directory?

DIR


How do you get all the files from the directory in PHP?

To list all the files in a directory you would use the following: $handle = opendir('/path/to/folder'); while(($file = readdir($handle)) !== false){ // do things with files // you will want to filter out things like ., .., and .htaccess echo $file; } Also, to return a list of all the files in a directory, especially with wildcards, use something such as: $file_array = glob("*"); $files = implode("\n", $file_array); echo $files; will give you a list of all the files directly.


What shows the content of disk drives?

The directory. It shows a list of files in the 'root' directory, along with the sub-directories.


What is the Directory?

A directory is commonly called a "folder" - it is a file that has a list that redirects the computer to the actual location of the files that are in that list. It's used more of as a organizational tool.


What command list basic directory files?

In Linux: ls In Windows: dir


How do you list all files from directory in PHP4?

Here is a small script that will get the files from the $folder variable using a dir function.