unix4artists/bash/paths.sh

51 lines
801 B
Bash

#!/bin/bash -e
#####################################################
#
# The commands "cd",
#
# Usage: bash bash/paths.sh
#
#####################################################
THIS_DIRECTORY=`pwd`
echo "${THIS_DIRECTORY}"
sleep 2
# Go to your "home" directory for your user
cd ~/
echo "You are now in:"
pwd
sleep 2
# Go to the root of your filesystem
cd /
echo "You are now in:"
pwd
sleep 2
# List all files and directories in "long" and "readable" format
ls -lh
sleep 10
# Return to the directory you started in
cd "${THIS_DIRECTORY}"
echo "You are now back in:"
pwd
sleep 2
# Go into the "bash" sub-directory
cd bash
echo "You are now in:"
pwd
# Return to the parent directory, the one you started in,
# by using the double period ".." notation
cd ../
echo "You are now back in:"
pwd