cd
cd it244
cd ex
mkdir ex11
cd ex11
ls -l /home/ghoffman/html/it244_html
ls to see the directory contents in reverse order by date
ls -ltr /home/ghoffman/html/it244_html
Here you are combining the options indicating you want a long listing (l), ordered
by date and time (t), in reverse order (r).
ls to see the access permissions on the it244_html directory
ls -ld /home/ghoffman/html/it244_html
Here you are combining the options indicating you want a long listing (l)
of the directory itself (d), not its contents.
df to see the disk space available on users3.cs.umb.edu
df
Notice two things.
df with the -h option
df -h
The free disk space is now much easier to read.
cat
cat --help
ls
ls --help
Notice that some help is very long.
cd
cd --help
cd does not respond to the --help option, or, for that matter, -h.
ls using only the name of the command
ls ~tsoro
ls executable file
which lsls using an absolute pathname
/bin/ls ~tsoro
This has the same effect as typing the name of the command on the command line,
which is also the name of the executable file for ls.
echo $PATH
Notice that each directory name is an absolute pathname separated by a colon, :.
cd ~/it244/ex/ex11
pwd
~tsoro/course_files/it244_files/hello.sh
cp ~tsoro/course_files/it244_files/hello.sh .
ls
hello.sh
You get an error message.
./hello.sh
Now the program runs.
ls with no options or arguments
ls
echo $?
Since ls ran without any problems, it returned an exit status of 0,
indicating that all went well.
ls on a file that doesn't exist
ls foobar
echo $?
Since ls failed, it returns a non-zero exit status.
ls --help | tail
Returning the value 2 means ls ran into a serious problem.
cd ~/it244/ex/ex11
nano ex11.sh
~tsoro/it244_test/ex11.sh
When the script asks if you are ready for more, hit Return or Enter.