File System; home, usr, var

 Idi na Hrvatsku Stranicu  Back  File System  Next


 home A place where you keep all data users mailbox (if you do not use Outlook, GMail or similar), personal web pages, and other things he created. What initially join the user is shown in Figure 5.1.2c in its directory [/home/USER_NAME]. If we want to see who the user (not rating) is currently using the system, the command serves this purpose ' finger ':

 drago@mak:~$ finger
 Login     Name            Tty      Idle  Login Time   Office     Office Phone
 drago     Drago Radic     pts/0          Jun 20 07:31 (iskon36-198.duo.carnet.hr)
 drago     Drago Radic     pts/2          Jun 20 10:19 (iskon36-198.duo.carnet.hr)
 eni       Eni Generalic   pts/1      43  Jun 20 09:36 (161.53.32.32)
 drago@mak:~$

Commands not in [/bin] directory, because not one of the basic commands to work on the system, but it is part of the installation of a distribution or later should be installed. Such software is installed in the directory [/usr/bin]. In order for users created personal web pages must be in your directory create a directory [public_html], which are not automatically created. So, there must be a directory [/home/USER_NAME/public_html] in that contains the initial files of Web sites index.html, index.php or another as defined for the names of the home page that the Web server knows automatically recognized. But this is not enough: they must be set to the directory [/home/USER_NAME] rights ' drwxr-xr-x ' that must be placed on the directory [public_html] and its contents. Performing rights ' x ' is set for a possible script execution. Then you can access the user's personal page via the following address by template:

      https://www.DOMAIN.TYPE/-USER_NAME/

It is not superfluous to note that once a user 'drago' is not the same as the user 'drago'; Linux is case-sensitive. Part of the list in [/home] directory is displayed on. The first three folders are ordinary directories (non-user) that the administrator uses for their needs and the character ' _ ' in order to be first on the list to help make them happen. They are placed there because the partition-directory [/home] quite free. Administrator that holds, among other things, various versions of configuration files from the directory [/etc].

 mak:/home# ls -alh | more
 total 1.7M
 drwxr-xr-x 390 root     staff    8.0K Jun 18 10:24 .
 drwxr-xr-x  22 root     root     1.0K Jun 20 12:26 ..
 drwx------   2 root     root     4.0K Jun 18  2004 _admin
 drwx------   2 root     root     4.0K Oct 20  2006 _backup
 drwx------   2 root     root     4.0K Jun 20 03:14 _script
     :
 drwx------   3 danci    stud     4.0K Apr  7  2009 danci
 drwx------   2 dodo     carnet   4.0K May 13  2005 dodo
 drwxr-xr-x  13 drago    inst     4.0K Mar 22 08:52 drago
 drwx------   2 duje     stud     4.0K Nov 20  2009 duje
 drwx------   3 edita    inst     4.0K Apr  8  2009 edita
 drwxr-xr-x   5 franko   inst     4.0K Jul 27 23:25 franko
 drwx------   6 nives    surad    4.0K Apr  5  2009 nives
     :
 mak:/home#

Take for example the users belonging to different groups, a duo from examples allow viewing of personal Web pages (which?). If two users have the same name and surname may cause errors in the e-mail receipt if received by form 'name.surname@domain.type' (mail goes first in the list), and when creating a new account to view the current situation in order to could find an acceptable solution. These problems are avoided if the mail is received by form 'user_name@domain.type' but also the previously mentioned solution must be available, of course, consistent with the current situation. The system does not create two users with the same user_name. The usual contents of a directory user is shown in the following list.

 mak:/home/drago# ls -alh
 total 46K
 drwxr-xr-x   5 drago inst  4.0K Jul 16 15:15 .
 drwxr-xr-x 391 root  staff 8.0K Jun 26 15:48 ..
 -rw-------   1 drago inst     0 Jul  9  1999 .addressbook
 -rw-------   1 drago inst   145 Jan  3  2007 .bash_history
 -rw-r--r--   1 drago inst   567 Jul  9  1999 .bash_profile
 -rw-r--r--   1 drago inst    90 Jul  9  1999 .bashrc
 -rw-r--r--   1 drago inst  1.2K Jul  9  1999 .cshrc
 -rw-r--r--   1 drago inst    37 Feb 10  2006 .forward
 -rw-r--r--   1 drago inst  2.3K Jul  9  1999 .login
 -rw-r--r--   1 drago inst    51 Aug 23  2004 .mailboxlist
 -rw-------   1 drago inst   17K Sep 21  2005 .pinerc
 -rw-r--r--   1 drago inst   602 Jul  9  1999 .profile
 drwx------   2 drago inst  4.0K Jul 16 07:24 Mail
 drwx------   2 drago inst  4.0K Sep 21  2005 mail
 -rw-------   1 drago inst   555 Jul 16 15:02 mbox
 drwxr-xr-x  11 drago inst  4.0K Jan  9  2007 public_html
 lrwxrwxrwx   1 drago inst     8 Jun 10  2005 web -> /var/www
 mak:/home/drago#

It has already been stated that Linux is case-sensitive user name and 'Drago' is not the same as the user name 'drago'. For the domain name and the domain type is not fundamentally important because Web servers and DNS servers this translate mainly in small letters.

 usr Includes program support and libraries and everything else that is not of importance necessary to run the system and ensure the necessary environment for users and administrators. The content of this directory primarily subdirectories as shown in the following list. It should be noted subdirectories [bin], [lib] and [sbin] which is fully equivalent to the structure of the file system. Since this is also the partition has its superblock and directory [lost+found]. All the contents in this chapter are part of the distribution that is supplied to the previously mentioned 8 DVDs.

 voda:/usr# ls -alh | more
 total 52K
 drwxr-xr-x 11 root root  4.0K 2010-07-31 22:17 .
 drwxr-xr-x 21 root root  4.0K 2010-04-18 11:44 ..
 drwxr-xr-x  2 root root   12K 2010-07-31 22:17 bin
 drwxr-xr-x  2 root root  4.0K 2010-04-18 11:42 games
 drwxr-xr-x  3 root root  4.0K 2010-07-31 22:17 include
 drwxr-xr-x 32 root root  4.0K 2010-07-31 22:17 lib
 drwxrwsr-x 10 root staff 4.0K 2010-04-18 11:42 local
 drwxr-xr-x  2 root root  4.0K 2010-07-31 22:17 sbin
 drwxr-xr-x 58 root root  4.0K 2010-07-31 22:17 share
 drwxrwsr-x  2 root src   4.0K 2010-01-25 04:41 src
 drwxr-xr-x  2 root root  4.0K 2010-07-31 22:17 X11R6
 voda:/usr#

In this directory is a subdirectory [local] which also contains its subdirectories [bin], [lib] and [sbin]. This set of data is usually related to program support outside distribution, from another source, and slip away into a separate directory to avoid any new versions of the files in the distribution interfere with these when you upgrade the system, because here are some of the installed files have the same name as files in the distribution. If these programs are in the directory [/usr/local] is of great importance for the users well this part in planning the allocation of logical drives, declared as its own partition with its own file system for easy maintenance.

 voda:/usr/local]# ls -alh
 total 40K
 drwxrwsr-x 10 root staff 4.0K 2010-04-18 11:42 .
 drwxr-xr-x 11 root root  4.0K 2010-07-31 22:17 ..
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 bin
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 etc
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 games
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 include
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 lib
 lrwxrwxrwx  1 root staff    9 2010-04-18 11:42 man -> share/man
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 sbin
 drwxrwsr-x  3 root staff 4.0K 2010-04-18 11:42 share
 drwxrwsr-x  2 root staff 4.0K 2010-04-18 11:42 src
 voda:/usr/local]#

Precisely because of this additional program support [/usr] may become the largest 'consumer' of disk space on the system. It is useful to look at the configuration of a new server configuration of an existing server with similar amenities, for immediate installation of a new server evenly distribute the available resources.

 usr/bin Executable file distribution which are not necessary for the basic functionality of the system and the use by the user and administrator. The following example shows a part of the content that refers to three different editors.

 voda:/usr/bin]# ls -alh |  more
 total 18M
 drwxr-xr-x  2 root root     12K 2010-07-31 22:17 .
 drwxr-xr-x 11 root root    4.0K 2010-07-31 22:17 ..
     :
 -rwxr-xr-x  1 root root    107K 2010-05-12 22:25 apt-get
     :
 lrwxrwxrwx  1 root root      22 2010-04-18 11:43 pico -> /etc/alternatives/pico
     :
 lrwxrwxrwx  1 root root      24 2010-04-18 11:55 rename -> /etc/alternatives/rename
     :
 lrwxrwxrwx  1 root root      20 2010-04-18 11:43 vi -> /etc/alternatives/vi
lrwxrwxrwx 1 root root 22 2010-04-18 11:43 view -> /etc/alternatives/view
lrwxrwxrwx 1 root root 21 2010-04-18 11:43 vim -> /etc/alternatives/vim : -rwxr-xr-x 1 root root 22K 2008-04-04 16:22 whoami : voda:/usr/bin]#

 usr/lib Static and dynamic content using files in the directory [/usr/bin] and [usr/sbin]. The above example is just a further illustration of the existence of the facilities listed in this directory. The directory [apt] contains libraries for all the modules that are used by the client software of the same name.

 voda:/usr/lib# ls -alh | more
 total 22M
 drwxr-xr-x 32 root root 4.0K 2010-07-31 22:17 .
 drwxr-xr-x 11 root root 4.0K 2010-07-31 22:17 ..
 drwxr-xr-x  3 root root 4.0K 2010-04-18 11:42 apt
 drwxr-xr-x  3 root root 4.0K 2010-04-18 11:52 dpkg
     :
 -rw-r--r--  1 root root  14K 2008-06-20 18:54 libsupp.a
 lrwxrwxrwx  1 root root   18 2010-04-18 11:42 libtasn1.so.3 -> libtasn1.so.3.0.15
 -rw-r--r--  1 root root  59K 2008-04-26 11:04 libtasn1.so.3.0.15
     :
 drwxr-xr-x  2 root root 4.0K 2009-07-30 20:48 X11
 voda:/usr/lib#

 usr/sbin Includes program support which provides additional services beyond the mandatory, as amavis, freeradius, slapd (LDAP) and others, which basically maintains the administrator, and not on direct customer service, but it helps him perform better basic services (clean viruses and spam from e-mail, etc.).

 voda:/usr/sbin]# ls -alh | more
 total 3.7M
 drwxr-xr-x  2 root root 4.0K 2010-07-31 22:17 .
 drwxr-xr-x 11 root root 4.0K 2010-07-31 22:17 ..
 -rwxr-xr-x  1 root root  63K 2009-01-24 13:31 accessdb
 -rwxr-xr-x  1 root root  19K 2009-12-16 12:17 acpid
 lrwxrwxrwx  1 root root    7 2010-04-18 11:42 addgroup -> adduser
 -rwxr-xr-x  1 root root  693 2008-06-27 15:54 add-shell
 -rwxr-xr-x  1 root root  34K 2008-08-10 23:35 adduser
 -rwxr-xr-x  1 root root  43K 2008-11-16 17:54 arp
 -rwxr-xr-x  1 root root  30K 2008-07-27 14:53 arpd
     :
 -rwxr-xr-x  1 root root 229K 2009-04-06 freeradius
	  :
 -rwxr-xr-x  9 root root 1.1M 2010-07-24 10:48 slapcat
 -rwxr-xr-x  9 root root 1.1M 2010-07-24 10:48 slapd
     :
 lrwxrwxrwx  1 root root   33 2010-04-18 11:43 traceroute -> /etc/alternatives/traceroute.sbin
     :
 -rwxr-xr-x  1 root root  64K 2009-11-14 15:41 useradd
-rwxr-xr-x 1 root root 40K 2009-11-14 15:41 userdel
-rwxr-xr-x 1 root root 63K 2009-11-14 15:41 usermod : -rwxr-xr-x 1 root root 38K 2010-06-06 02:24 zic voda:/usr/sbin]#

 var This directory has a multiple purpose of which is the most basic:

But from the above it can be concluded that these partitions require a fairly large percentage of the total available disk space. Even if the supply of all kinds under the seat and a large number of users quite grubby (those who are looking for an account because this belongs to, and did not read the mail), the contents on this partition can really grow volume. Therefore, it can be reported in time jobs (cron jobs) set automatically delete stored mail older than ' X ' days, a record of events in the system periodically to be copied to the new file and compressed in a way that the new records replace the oldest by default criterion - ROTATION of logs. Example of storing the last eight entries in syslog file in which all events are monitored on a single server system is shown in the following figure.

 mak:/var/log# ls -alh
 total 64M
 drwxr-xr-x 13 root    root     4.0K Jun 20 07:35 .
 drwxr-xr-x 15 root    root     4.0K Jun 20 12:39 ..
     :
 drwxr-xr-x  2 root    root     4.0K Jun 15 07:35 apache2
     :
 -rw-r-----  1 root    adm      2.1M Jun 20 16:46 syslog
 -rw-r-----  1 root    adm      4.7M Jun 20 07:35 syslog.0
 -rw-r-----  1 root    adm      599K Jun 19 07:35 syslog.1.gz
 -rw-r-----  1 root    adm      594K Jun 18 07:35 syslog.2.gz
 -rw-r-----  1 root    adm      574K Jun 17 07:35 syslog.3.gz
 -rw-r-----  1 root    adm      475K Jun 16 07:35 syslog.4.gz
 -rw-r-----  1 root    adm      468K Jun 15 07:35 syslog.5.gz
 -rw-r-----  1 root    adm      526K Jun 14 07:35 syslog.6.gz
     :
 mak:/var/log#

View syslog files can be performed to the command ' cat ' and ' less ':

 mak:/var/log# cat syslog | more   (review of file window by window)
 mak:/var/log# less syslog         (expanded command 'more', which cancels with 'q')

APACHE web service, with regard to their particular needs and demanding their records kept in a separate directory, as shown in the following list. It is useful to compare the size of its tracks from the previous instance to get a picture of the use of this service on a server that has been taken in the previous example.

 mak:/var/log#
 mak:/var/log# cd apache2
 mak:/var/log/apache2# ls -alh
 total 325M
 drwxr-xr-x  2 root root 4.0K Jun 15 07:35 .
 drwxr-xr-x 13 root root 4.0K Jun 20 07:35 ..
 -rw-r-----  1 root adm  136M Jun 20 16:51 access.log
 -rw-r-----  1 root adm  126M Jun 15 07:35 access.log.1
 -rw-r-----  1 root adm  8.7M Jun  9 11:00 access.log.2.gz
     :
 -rw-r-----  1 root adm  8.0M Jun 20 16:50 error.log
 -rw-r-----  1 root adm  4.4M Jun 15 07:35 error.log.1
 -rw-r-----  1 root adm  174K Jun  9 11:00 error.log.2.gz
     :
 mak:/var/log/apache2#

Attack vast amount of contaminated mail with large files can be quickly filled this partition. Observant system administrator will make a script that will examine every hour availability disk systems, and in the case of established anomaly send him an email about it. In case of need, can be dynamically track records so that the end of the log file monitor how the new events are recorded using the command ' tail ' as shown in the next example.


Example IV

Dynamic track record of 'log' file on one server using the command ' tail '.

 mak:/var/log# tail -f syslog
 Jun 20 16:53:17 mak postfix/smtpd[23898]: disconnect from static- .......
 Jun 20 16:53:17 mak check[23758]: [ 2] [bootup] Logging initiated ....... 
 Jun 20 16:53:20 mak check[23758]: [ 3] mail 1 is known spam. 
 Jun 20 16:53:20 mak amavis[23758]: (23758-08) Blocked SPAM, [70.19.118.103] ....
 Jun 20 16:53:20 mak postfix/smtp[23907]: ABBA6129486: to=<fi ....... BOUNCE)
 Jun 20 16:53:20 mak postfix/qmgr[14543]: ABBA6129486: removed
     :
 mak:/var/log#

Interrupt execution of commands with a key combination <CTRL> + <C>.

The entries in the log files are the basis for the successful performance of FORENSICS in the case of 'attack' on the system, or if you simply want to monitor the behavior of a service. One should be aware that the 'attacker' you make the first attempt to delete these files to cover his tracks. What are the important data BACKUP data, among which are those records, work will be more frequent.

 lost+found Each file system has a directory that this occurs at the moment of creating a file system. Usually it is empty. But if for some reason there is a crash and the system becomes unstable, triggering the command ' fsck ' (filesystem check) that is to be started and when you turn on the computer and if it finds any file that has no name, it is placed in this directory. The administrator decides what to do with her, try to 'fix' and return to the user or simply delete everything. This command is not recommended to use when the system is valid and active. How does this create a directory on the file system, and each partition is created a separate file system, this means that it will be created in each of them and not in any of the directory to mount the root filesystem.

 voda:/lost+found# ls -alh
 total 20K
 drwx------  2 root root  16K 2010-04-18 11:41 .
 drwxr-xr-x 21 root root 4.0K 2010-04-18 11:44 ..
 voda:/lost+found#



SUMMARY:

 Rest Anything that the user needs, and is not listed here, can be found on the system or execute the command with options that direct the operation of the controls - ' KW option '. To commands successfully used it is useful to chained them together ( | ) with the command to extract the results by some peculiarities - ' grep peculiarities '. Commands and instructions, has a lot. If using the GUI 'life' is much simpler.

Why are so detailed (or insufficiently detailed?) story of the Linux operating system and its commands? From the very simple reason that almost all quality system adjustment can be made only in a console or terminal-emulator using an editor and change the configuration settings of a service which is then stopped and restarted to make the new settings are accepted. Graphic interfaces are richer and more functional, but it can not replace a powerful command line regarding system configurations. Computer shut down basically no. To maintain the system in accordance with the said default is that the user knows how to use the command line basis until at least the rest do not learn it from the available sources. Clicking the inherent 'windows'.

More detailed descriptions of the individual commands in this reading of no, because in the end available extensive documentation and Internet facilities. Besides the dots on the icon in the corner illustrate that this is just the top of a 'Linux iceberg' and that they should work harder to inspect it. The purpose of this reading is that the novice users to 'paint' with which he will meet a greater or lesser extent, depending on how much he likes to 'play'. The core of the system is definitely combines the functionality so far described only a little story. Is loaded at startup and allows control of the network. Because of its importance and the process will be one of the next chapters.

A couple of small observations: execute each command can be interrupted combination <Ctrl> + <C>; logging out from shell is possible with <Ctrl> + <D>; keyboard shortcuts for copying and downloading content of file or entire files are <Ctrl> + <Ins> i <Shift> + <Ins>; <Q> to exit the individual commands (like ' less ') or help pages; RESET of computer and not check the system with <Ctrl> + <Alt> + <Del>. So, a little different than Windows OS.


 Back
 Search
 Next

Citing of this page:
Radic, Drago. " Informatics Alphabet " Split-Croatia.
{Date of access}; https://informatics.buzdo.com/file.
Copyright © by Drago Radic. All rights reserved. | Disclaimer
 Content - Home
 Content  Informatics Alphabet