Dana Vrajitoru
C151 Multi-User Operating Systems
Linux Organization and Components
Linux File Systems
- / root directory
- /bin executable for single user mode
- /dev devices that can be mounted by the system
- /etc local configuration, administrative things
- /home home directories for most users
- /lib shared libraries
- /mnt mountable devices - temporary mount point for mountable
devices
- /proc kernel and process information
- /root home of the superuser (root)
- /sbin system binaries (executables)
- /tmp temporary files
- /usr lots of information used by the system
- /usr/lib libraries that can be linked in C++ programs,
like math (libm.a or libm.so)
- /usr/include all the header files
- /var variable data - files whose contents change
at runtime
Linux Users
- There is one special user that has administrative powers - the superuser.
It's name is root.
- Every user has a home directory that can be found under /home/username.
They have an allocated disk space called the quota.
- The home directory contains configuration (resource) files that define
their environment. They all start with a dot. Example: .signature.
- For example, the file ".cshrc" will always be executed whenever the
user logs in or opens a terminal window.
- Each type of shell loads their own resource file. Example: .bashrc.
File Ownership and Permisions
- Every file belongs to a particular user, generally the creator of that
file. This is the owner of the file.
- Users may be organized in groups and a group can have special
permissions to a file.
- A file can be accessible for reading r, writing w, or
executing x. To view the content of a directory, the directory should
be executable.
- Usually the owner has read and write permission to a file, also execute
permission if applicable. The root (su) had read and write permissions
for any file (!!)
- The command ls -l displays the permissions of a file for the owner,
the group, and everyone else (all).
- To change the permissions and ownership: chmod, chown.
Compressing Files
- The most common utilities for compressing and decompressing files on Linux
are tar and gzip.
- The tar archiving utility allows us to compress several files into one
archive and even whole directories at a time.
- Its name comes from tape archive.
- Options: cf for compressing, xf for decompressing.
- The gzip utility compresses one file at a time.
- Options: none to compress, -d to decompress.
- To archive more than one file, most people use a combination of tar
and gzip in that order. Those archives have the extension .tar.gz
or simply .tgz.