Answers for "linux list all folders and subfolders"


bash how to print the directory structure in linux

# Process:
1. Install the tree package with your favorite linux/unix installer, e.g.
	sudo apt-get install tree	# Using apt-get installer
    brew install tree			# Using brew installer
2. Run tree to see directory structure, e.g.:
	tree /directory/to/visualize/

# Note, you can specify the depth you want to visualize with the -L flag
# 	and you can display only directories with the -d flag, e.g.:
	tree -L 1 # Print the directories in the current directory
    tree -L 2 # Print current and subdirectories and files
    tree -L 2 -d # Print current and subdirectories

# Note, if you use tree a lot, using the following aliases can save you 
# some time:
	alias tree1='tree -L 1'
    alias tree2='tree -L 2'
    alias tree3='tree -L 3'
Posted by: Guest on October-03-2020

get list of all files in folder and subfolders python

for path, subdirs, files in os.walk(root):
    for name in files:
        print os.path.join(path, name)
Posted by: Guest on December-07-2020

linux list directories

ls -d */
Posted by: Guest on June-15-2020

Code answers related to "linux list all folders and subfolders"

Browse Popular Code Answers by Language