You are on page 1of 2

Linux File System

1. Linux uses ext2/ext3 file system, whilst Windows95/98/ME/XP use FAT or FAT23 file
system, and Windows NT/2000/XP/2003 use NTFS file system. The Linux file system is like
a tree branching out from the root directory (/). Login using the student username and
password, password, use pwd, cd, ls commands to draw the file system structure of Linux
operating system on your PC.

2. Use df command to display the usage of the space in Linux system.

3. Go to your home directory, use du command to display the file size details in the current
directory and sub-directory.

4. Following are the Linux commands for daily uses, try them out!

pwd display the full path current directory


ls display the content of current directory
cd change directory
cp copy files
mv move or rename files
rm delete files
mkdir / rmdir create or delete an empty directory
vi text file editor
cat display the content of a text file
head / tail display the first / last few lines of a text file
more / less display the content of a text file one full screen a time
grep search for a pattern (text string) in files
wc word count command
cal display a calendar
date display the date and time
w / who display the logged in users
finger display the details of a user
su switch user
whoami display your username
1
5. What are the differences between following commands? ls -l, ls -a, and ls -F. Write
down a few examples for file permission.

6. Linux will show its real power when you combine several commands together using |, try
following commands and state the differences.

ls -l /etc
ls -l /etc | grep conf
ls -l /etc | grep conf | more
ls -l /etc | grep conf | tail
ls -l /etc | grep conf | tail | wc

The following set of steps are optional go to step 13 if you do not wish to do them
7. In Linux, you can access different file system by using mount, for example, following will
open a MS-DOS floppy for use (insert the MS-DOS floppy disk first!):

CIS023-6 Network Administration and Management


1
mount -t msdos /dev/fd0 /mnt/floppy
1
8. To create a new file, type touch try.txt.

9. To transfer a file, type cp try.txt /mnt/floppy.

10. To finish, type umount /mnt/floppy.

11. To remove the file, type rm try.txt.

12. You can also use rm to remove folders, even if they are not empty, how?

13. If you still have time, go to the KDE graphical interface by typing startx, and find out
what are the graphical equivalent programs for the above tasks.

Questions:
1. How can you display a files or directorys permission? What do permissions and mean? How
do you translate them into numerical values?

-rwxr-xr-x
-rw-rw-r--
drwxr--r--

2. Briefly explain what are following directories for in a Linux file system, /dev, /etc,
/home, /bin, /usr, /tmp, /var etc.

3. Use Linux man pages to understand the use pwd, ls, df, du, chmod, cp, mv, rm, cat, pico,
more, less, head, tail, grep, tar.

4. What is the purpose of | in Linux command line system?

5. How can you use su command to switch from ordinary user to root user, and vice versa?

6. How to mount the CDROM under Linux?

7. What is the quickest way to go back to your home directory?

CIS023-6 Network Administration and Management


2

You might also like