Skip to content

This Python script makes you list all the files in a specific directory (path) and output them in a file with the number of files founds.

Notifications You must be signed in to change notification settings

nassimessaidi/Get-the-files-name-in-a-specific-directory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Get-the-files-name-in-a-specific-directory

You can extract the names of the files in current directory (path) or another custom directory in your OS.

Description

You can extract just the files in a specific directory or path, for example, if you have files inside another directory the script can not walk into it, so it behaves like a -maxdepth 1 parameter if you are familiar with the Linux command. So, It's shown only the files exists in that current directory without entering to other folders to look for all files into it.

After extracting all the files names in the target directory, the script stores them in a file called directory.txt with the number of files out there.

You can either pass an absolute path or relative path.

The script comes with more comments to describe almost every line of code on it.

Requirement

  • Python 3.8, It can work with other versions especially any version of python 3.x (I've not tested it on version 2.x).
  • OS Module, It comes preinstalled with python package.

Running the Script

Run the script

Open the output file directory.txt

About

This Python script makes you list all the files in a specific directory (path) and output them in a file with the number of files founds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages