
CS361 -- Project1 (Exploring introductory Linux)
Note: Be precise with your answers! For example would Ls and ls give you the same thing? Your work must be done
on (or telnetting into) our Linux machines in MAK 1135. Either type up your solutions or write very neatly. If you
work with one other person, hand in one copy with both your names on it and make sure you both understand each
problem and your solution. Note: Some questions may require you to look at some other commands in Sobell that we
have not specifically covered.
1. Suppose you have the following:
[eos10:/home/vangorpm/cs361f00/projects/project1]$ ls -l
total 12
drwxr-xr-x 2 vangorpm users 4096 Aug 29 09:51 dir1
drwxr-xr-x 2 vangorpm users 4096 Aug 29 09:53 dir2
drwx------ 2 vangorpm users 4096 Aug 29 11:02 dir3
-rw-r--r-- 1 vangorpm users 0 Aug 29 09:49 file1
-rw-r--r-- 1 vangorpm users 14 Aug 29 09:50 file2
[eos10:/home/vangorpm/cs361f00/projects/project1]$ <command?>
drwxr-xr-x 2 vangorpm users 4096 Aug 29 09:51 dir1
drwxr-xr-x 2 vangorpm users 4096 Aug 29 09:53 dir2
[eos10:/home/vangorpm/cs361f00/projects/project1]$
What <command?> (and any options?) will give you exactly the final listing above (i.e. the stuff in bold)?
2. State specifically how you could create file1 of size 0 bytes above. Your answer may not include an editor and must
be a command.
3. Suppose your current working directory contains file1 and file2. Write a command that would create another file
named file3 in the same directory that has the same i-node # as file1 (see listing below for final result after command).
[eos10:/home/vangorpm/cs361f00/projects/project1]$ ls -il
total 0
2048071 -rw-r--r-- 2 vangorpm users 3 Aug 29 10:05 file1
2048072 -rw-r--r-- 1 vangorpm users 0 Aug 29 10:07 file2
2048071 -rw-r--r-- 2 vangorpm users 3 Aug 29 10:05 file3
[eos10:/home/vangorpm/cs361f00/projects/project1]$
4. Write a one line command that you can use to display all (and only those) files in your current directory that end in
.c (dot c)? FYI: It is ok if the command also displays files in subdirectories that end in .c
5. Write a one line command that you can use to list all files in your current directory that contain a space?
6. Explain why du -b gave the output 12288? It appears that only 112 bytes are being used.
[eos10:/home/vangorpm/cs361f00/projects/project1/dir1]$ ls -l
total 8
-rw-r--r-- 1 vangorpm users 56 Aug 29 09:51 file3
-rw-r--r-- 1 vangorpm users 56 Aug 29 09:51 file4
[eos10:/home/vangorpm/cs361f00/projects/project1/dir1]$ du -b
12288 .
7. What happens when you attempt rmdir on a directory that contains files?