0% found this document useful (0 votes)
8 views1 page

Laboratory Session 1: Shell Commands On Linux Man

The document outlines a laboratory session for an Operating Systems course focused on Linux commands and C/C++ programming. Students are required to familiarize themselves with shell commands and write a program that verifies if given numbers are 'growing numbers' with increasing digits. The program must handle errors and be submitted in a specific format by the end of the lab class.

Uploaded by

dohoangtruonghuy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Laboratory Session 1: Shell Commands On Linux Man

The document outlines a laboratory session for an Operating Systems course focused on Linux commands and C/C++ programming. Students are required to familiarize themselves with shell commands and write a program that verifies if given numbers are 'growing numbers' with increasing digits. The program must handle errors and be submitted in a specific format by the end of the lab class.

Uploaded by

dohoangtruonghuy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Operating Systems Course: IT077IU

HCMC International University Time: 120 minutes

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.

Problem 1.1: Shell commands on Linux (0 points)

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:

• Hit Ctril + Alt + T to open a terminal where students try commands

• 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, ...

Problem 1.2: Growing program (10 points)

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:

$ grow 1 23 144 3689


1 is not a growing number
23 is a growing number
144 is not a growing number
3689 is a growing number

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.

You might also like