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 datels -ltr /home/ghoffman/html/it244_htmlHere 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 directoryls -ld /home/ghoffman/html/it244_htmlHere 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 pe15.cs.umb.edudfNotice two things.
df
with the -h optiondf -hThe free disk space is now much easier to read.
cat
cat --help
ls
ls --helpNotice 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 commandls ~ghoffman
ls
executable filewhich ls
ls
using an absolute pathname/bin/ls ~ghoffmanThis 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 $PATHNotice that each directory name is an absolute pathname separated by a colon, :.
cd ~/it244/ex/ex11
pwd
~ghoffman/course_files/it244_files/hello.sh
cp ~ghoffman/course_files/it244_files/hello.sh .
ls
hello.shYou get an error message.
./hello.shNow the program runs.
ls
with no options or argumentsls
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 existls foobar
echo $?Since
ls
failed, it returns a non-zero exit status.
ls --help | tailReturning the value 2 means
ls
ran into a serious problem.
cd ~/it244/ex/ex11
nano ex11.sh
~ghoffman/it244_test/ex11.shWhen the script asks if you are ready for more, hit Return or Enter.