Laboratory Session 1: Shell Commands On Linux Man
Laboratory Session 1: Shell Commands On Linux Man
Laboratory Session 1
This session aims at revising Linux commands and C/C++ programming. The focus is on using
commands to learn about the Ubuntu operating system and writing C/C++ programs to do some
particular tasks.
Read The Linux command line for beginners to recall the Linux background. Using the man
command to explore a set of shell commands that focus on the following issues:
• Files and directories: mkdir, ls, mv, rm, cp, find, chmod, ...
• Editors: vi, emacs, gedit, notepad, ... Students can use gedit to write C/C++ code.
• System information: uname, vmstat, netstat, df, du, ps, top, env, ...
Write a C/C++ program that accepts N positive integral numbers from the command line and
verifies whether those numbers are growing numbers. A growing number contains digits (from left
to right) arranging in an increasing order, e.g., 1245, 258, ... At the end, the program prints out
each number with the answer. An execution of the program on the command line might look like
this:
The programs must handle error situations (including wrong input) in a meaningful way. Make
sure the program compiles cleanly with gcc -O2 -Wall -lm.
The solution (only one .c file) is formatted in name id l1.c and submitted to the Blackboard system
by the end of the lab class. Note that students are responsible for missing/duplicated files due
to wrong formats. Copying the whole source code from various sources such as the Internet is
disallowed.