Example 01: the File system

On a Mac or Linux system, or on Windows with the WSL or Cygwin installed, try some commands:

Who are you?


Where in the filesystem are you right now?


File listing


File listing with switches

l for long form, t for order by last modified, h for show sizes in human-readable units.

ls -lth

Piping output

ls | wc -l

The file system structure

# Show the directory structure (excluding files) for this project
# up to two levels deep. Just use "tree -d -L 2" at the console. 
# I can't use that here without getting some font rendering errors.
find . -type d -maxdepth 2 -print 2>/dev/null | awk '!/\.$/ {for (i=1;i<NF-1;i++){printf("│   ")}print "├── "$NF}'  FS='/'

Moving around

## Enter a directory
cd files
## Move up to parent directory
cd ..
## Move directly to top of home directory
cd ~
## Move back to the previous directory, wherever that was
cd - 
## Move down a path relative to where you are now
cd files/bib
## Move down then back up two levels
cd files/bib
cd ../../