Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 916 Bytes

ls.md

File metadata and controls

42 lines (32 loc) · 916 Bytes

LS

Means list. Useful to see what files exists in a path/current directory.

# I'm in '~', the command below list files in my current directory
ls
# list files in specific path
ls /Users
# If you want see hidden files, use the flag -a, means 'all'
ls -a /
# useful to check if a file exists, if file exists, return files founded, if not, return 'No such file or directory'
ls ~/Desktop/test.js

Note

Always that you will write a path to a file, you can use glob files, to productivity. Glob files, is a way to set path to files using sets of filenames with wildcard characters.

# list only files in path, that have an extension .js
ls ~/Desktop/projeto1/*.js
# list only files in path, that have an extension .js
ls ~/Desktop/projeto1/*.js
# the double **, is to recursevely list inside projeto1
ls ~/Desktop/projeto1/**/*.js