Линуксын хавтаснуудын талаар

Linux болон нээлттэй эхийн програм хангамжтай холбоотой асуудлууд, ерөнхий ойлголт.

Зохицуулагч: Bathuyag

Post Reply
Хөрөг
Almas
☆★☆卍 ★ 卍☆★☆
☆★☆卍 ★ 卍☆★☆
Бичлэг: 2639
Элссэн: 2005-02-12, 22:25
Танилцуулга: Монголчууд маань компьютер гэдэг юмыг гартаа оруулж бүгд өөр өөрийн ажил, амьдралдаа мессенжер, тоглоом тоглох, бичиг баримт шивихээс илүүгээр ашиглаад сурчихвал улс орны маань хөгжил тэр чигээр нь чирснээс илүү дугуйтай тэргэн дээр тавиад түрсэн мэт урагшаа өнхрөх байх гэж боддог юм. Анх 2005 оноос Дусал.нэт веб сайтыг Форум хэлбэрээр ажиллуулж эхлэсэн. Олон олон найзуудтай болсон, хамтарч бас нэлээд юм сурч мэдсэн, гэж боддог. Цаашдаа ч гэсэн...
Байрлал: Дэлхий дээр л ;-)
Contact:

Линуксын хавтаснуудын талаар

Бичлэг Бичсэн Almas »

Kamikaze гишүүн асууж байсан, энд нэг ийм товч тайлбар оллоо. Одоохондоо Англиар нь оруулчихъя...

A guide to files and folders on Linux

Beginner's Linux Tutorials


In my second tutorial about Linux, I’m going to look at files and folders and how they work on Linux - because it’s very different compared to the Windows way of C:, D:, and E: etc.

Basically, in Linux (and other Unix-based systems, but I’ll keep it simple for now), there aren’t different drives. In Linux, everything you can access stems from the top folder in the stack. It’s called the root folder and it can be accessed using a single forward slash - /.

Everything else is a folder (or directory, in Unix speak) underneath this forward slash. Your home folder (the equivalent of My Documents) will be at /home/yourname. That means:

“From the root folder, go into the home directory and then go into the yourname directory.”

Also, remember that every folder and file is case-sensitive, so myfile is not the same as MYFILE or mYFilE. Just bear that in mind.

Mounting Media

So that’s fine for all the stuff on your computer, but what happens if I insert a CD or a USB stick or something? How do I access that? The answer is that the contents of the CD, for example, are mounted in a folder. That basically means that the folder becomes a container for everything on the CD.

Most of the time, when you insert some media, your distro does the work of automatically mounting the contents into a folder, so you don’t see this. To find mounted media, you need to look into a folder called /media (open it up in a file manager), or sometimes /mnt. There should be a list of folders corresponding to the media you have inserted (can’t see anything? Insert something).

Having said that, you aren’t restricted to mounting stuff in these folders, it’s just a convention; if you want you could mount something in your home directory, but I’ll leave that for another tutorial.

Symlinks
OK, got that? Because there are more concepts coming up now. Now in the Linux filesystem, there are also things called symlinks (in fact, there are also hard links, pipes, block devices, character devices and more, but I said I’m keeping it simple). Symlink means ’symbolic link’ and is a bit like a shortcut, but a lot more powerful. A symlink doesn’t just link to a different file, when you perform operations on it, it acts exactly as if it is that file. The advantages of this are a bit geeky, but believe me it comes in handy a lot of times.

An example of a symlink in action is in my home folder. I do a lot fo web development, so I need quick access to the files on my web server. Rather than me finding the web server documents folder (/var/www/html) every time I want to save or open, I create a symlink in my home directory. That way, not only do I get there quickly, but I can work with the web documents just as if they were actually inside my home directory (all the paths say /home/peter/htdocs/mylatestproject, rather than /var/www/html/mylatestproject).

Permissions

I won’t go into detail here, there’s enough stuff on permissions to make a tutorial in itself, but basically on your Linux filesystem, different people ‘own’ different folders and files and have the right to grant or deny other people permission to read and write to the files they own.

The super-administrator, root (not to be confused with the root filesystem / or root’s home folder /root) has access to every file regardless of its owner or permissions. This is why you should never run as root - it’s so easy to make a mistake that would bring down your whole system.

A lot of the files in Linux are owned, controlled and locked down by root. This includes important system files, folders and programs etc. You won’t be able to edit or delete these files yourself, without first logging on as root (be very careful).

For the files that you own (generally, stuff in your home folder), you can control permissions (you can prevent other users, but not root, from reading or writing to your data). By default, most distributions set your home folder to be readable by others, but not writable by others. It’s out of the scope of this tutorial to go into changing it, but if you’re interested, investigate the command chmod (or look at your file manager, it should be able to change permissions graphically).

Common Folders

I hope you have a fairly good understanding now of how the file system basically works, so now I’m going to iterate through some of the common folders you find on a Linux system, and what they’re for.
Name Purpose
/ The root folder, where everything starts, and everything is contained in this folder (or under subfolders of this folder).
/bin Contains system-critical programs (binaries)
/boot Contains files needed for booting (be careful!)
/dev Contains files which can be used to directly access your hardware (files to manipulate all your hard drives etc)
/etc Contains mainly configuration files for various programs/system stuff.
/home Contains a folder for each user (except root) where they can store their personal files.
/lib A folder for system-critical libraries.
/root The home folder for root - the super-administrator (generally will be locked to normal users so you can’t take a peek).
/media Contains folders for the media attached to your system (CDs, DVDs and USB sticks etc)
/opt Optional software - like desktop environments etc.
/proc A system folder, it’s a bit scary so I won’t go into it!
/sbin Contains essential programs only designed to be run by root.
/tmp Temporary files, deleted every restart.
/usr Stands for Unix System Resources (not user as is commonly said). Contains lots of stuff, so I’ll look into it below.
/usr/bin Contains virtually every single program you use.
/usr/lib Contains virtually every system library that programs require to run.
/usr/local Contains programs that you have manually compiled rather than installed from a package.
/usr/sbin Contains virtually every program designed to be run by the super-administrator, root.
/usr/X11R6 Houses files which power the X Window System (X version 11 release 6), which is the basis of almost every graphical environment.
. Dot (that’s a full stop) means the current directory. Mainly used to start programs in the current directory (like ./configure for example).
.. Two full stops means the directory one up from the current directory. So if you’re in /home/peter going to ../ would take you to /home.
~ The tilde symbol means your home directory - so that will be /home/yourusername.

This is just a brief look at the file system on Linux, but I hope it’s helped you understand a bit more how Linux works. More tutorials to come.

Version 1.0 - initial version
Version 1.1 - contains ., .. and ~ in Common Folders and finishes the section about case-sensitivity which I *cough* didn’t finish.
Харь гаригийнхан байдаг :D
Хөрөг
Khaschuluu
™Дусал®
™Дусал®
Бичлэг: 311
Элссэн: 2009-01-28, 16:51
Байрлал: Улаанбаатар
Contact:

Бичлэг Бичсэн Khaschuluu »

ээ тэнгэр минь энэ юу болох нь энэ вэ? Алмасыг Англи хүн байсаныг нь одоо л мэдлээ. :D Заза гэхдээ юу болохыг нь би лав ойлгосонгүй
Хөрөг
kamikaze
Жирийн Нэгэн
Жирийн Нэгэн
Бичлэг: 18
Элссэн: 2009-01-14, 01:20

Бичлэг Бичсэн kamikaze »

зиа алмас энд гоё л юм бичсийм шиг байна хавтаснуудын талаар гайгүү ойлголттой болчихмоор л байна шүү :D
ойрд нэтэд орж ирэх боломж хомс ховор л орж ирж байна даа бас залхуу гэжугаа дараа орж ирэхэд монгол болгоцон байгаасай нтр :P
Хөрөг
Khaschuluu
™Дусал®
™Дусал®
Бичлэг: 311
Элссэн: 2009-01-28, 16:51
Байрлал: Улаанбаатар
Contact:

Бичлэг Бичсэн Khaschuluu »

Kamikaze гишүүн асууж байсан, энд нэг ийм товч тайлбар оллоо. Одоохондоо Англиар нь оруулчихъя...
За алмас одоо англи юмыг англиар орчуулаад байхдаа яадагийн хэхэ.
за би эндээс хальт хараад ёр нь C: D: дискнүүд юу гэсэн үг вэ? бас mount гэдэг нь санах ойнуудыг системд ачаалахыг хэлээд байна, бас системийн хавтаснуудын үүргийн тухай яриад байна гэж ойлоглоо. Алмас өөрөө ойлгож байвал хальтл мулт л орчуулаад, чадвал вики дээр тавиад энд хаягийг нь зарлачхаарай.
Хөрөг
Khaschuluu
™Дусал®
™Дусал®
Бичлэг: 311
Элссэн: 2009-01-28, 16:51
Байрлал: Улаанбаатар
Contact:

Бичлэг Бичсэн Khaschuluu »

Маш хэрэгтэй зүйл байна. Над мэтийн эхлэгчдэд ;)
almas offline

Бичлэг Бичсэн almas offline »

hehe хүн ийм гоё юм олж ирж байхад даа та нар :d орчуулаад уншцгаа л даа. Ер нь бол системийн хавтаснуудын үүрэг хаана юу байдаг талаарх ерөнхий ойлголт гэж ойлгож болноо. Сонирхсон хүмүүс нь өөрснөө орчуулаа ;) орчуулаад тавьчихвал баярланаа гсн хэхэ

нээрээ хавар боллоо мод тарих юмсан...
Хөрөг
Khaschuluu
™Дусал®
™Дусал®
Бичлэг: 311
Элссэн: 2009-01-28, 16:51
Байрлал: Улаанбаатар
Contact:

Бичлэг Бичсэн Khaschuluu »

би л лав хэдэн мод хөдөө гэрийнхээ хашаанд үрслүүлчихсэн байгаа. Дулаараад ирэхээр ургана гэж найдаж байна.

Чацаргана
Ёолк
нарс гээд л. Зуун жилийн дараа манай хушнаас самар ургана. зуун жил хүлээж чадвал дусалынхантай хуваалцнаа гэж :D

алмас яагаад сүүлийн үед офлайнаар орж ирээд байна. өөрийн бичсэн бичлэг хэтэрхий их байна гэж ингээд байна уу :P
Хөрөг
Khaschuluu
™Дусал®
™Дусал®
Бичлэг: 311
Элссэн: 2009-01-28, 16:51
Байрлал: Улаанбаатар
Contact:

Бичлэг Бичсэн Khaschuluu »

алмасгуайд дээр бичсэн шиг хирнээ hard disc дээрх биш iso CD дээрх хавтаснуудын тайлбар олох арга байна уу. Дээрх нээрээ үнэхээр хэрэгтэй зүйлүүдийн нэг юм байна. Үнэхээр их баярлаа.
Хөрөг
Almas
☆★☆卍 ★ 卍☆★☆
☆★☆卍 ★ 卍☆★☆
Бичлэг: 2639
Элссэн: 2005-02-12, 22:25
Танилцуулга: Монголчууд маань компьютер гэдэг юмыг гартаа оруулж бүгд өөр өөрийн ажил, амьдралдаа мессенжер, тоглоом тоглох, бичиг баримт шивихээс илүүгээр ашиглаад сурчихвал улс орны маань хөгжил тэр чигээр нь чирснээс илүү дугуйтай тэргэн дээр тавиад түрсэн мэт урагшаа өнхрөх байх гэж боддог юм. Анх 2005 оноос Дусал.нэт веб сайтыг Форум хэлбэрээр ажиллуулж эхлэсэн. Олон олон найзуудтай болсон, хамтарч бас нэлээд юм сурч мэдсэн, гэж боддог. Цаашдаа ч гэсэн...
Байрлал: Дэлхий дээр л ;-)
Contact:

Бичлэг Бичсэн Almas »

Интернет кафегаас орох үедээ нууц үгээ алдах вий гэж болгоомжлоод офлайн орж байсан юм. Өөрийн РС дээрээс л нэвтэрч ордог ;)

гүүглдээд хайвал уг нь байгаа л байх даа...
Харь гаригийнхан байдаг :D
Хөрөг
Almas
☆★☆卍 ★ 卍☆★☆
☆★☆卍 ★ 卍☆★☆
Бичлэг: 2639
Элссэн: 2005-02-12, 22:25
Танилцуулга: Монголчууд маань компьютер гэдэг юмыг гартаа оруулж бүгд өөр өөрийн ажил, амьдралдаа мессенжер, тоглоом тоглох, бичиг баримт шивихээс илүүгээр ашиглаад сурчихвал улс орны маань хөгжил тэр чигээр нь чирснээс илүү дугуйтай тэргэн дээр тавиад түрсэн мэт урагшаа өнхрөх байх гэж боддог юм. Анх 2005 оноос Дусал.нэт веб сайтыг Форум хэлбэрээр ажиллуулж эхлэсэн. Олон олон найзуудтай болсон, хамтарч бас нэлээд юм сурч мэдсэн, гэж боддог. Цаашдаа ч гэсэн...
Байрлал: Дэлхий дээр л ;-)
Contact:

Бичлэг Бичсэн Almas »

Зураг
  • * / – Root directory for the entire hierarchy
    * /bin/ — run the program files user
    * /boot/ — static files for booting the system
    * /dev/ — device files
    * /etc/ — System-specific configuration files
    * /home/ — home directories of users
    * /lib/ — shared libraries and kernel modules
    * /media/ — mount point for removable devices
    * /mnt/ — mount point for temporary file systems
    * /opt/ — additional software packages
    * /sbin/ — run the system files
    * /srv/ — data services for systems
    * /tmp/ — Temporary Files
    * /usr/ — custom tools and applications
    * /var/ — modify the file (variables)
    * /root/ — root user home folder
    * /proc/ — kernel virtual file system documents, the status of processes in the form of text files
Харь гаригийнхан байдаг :D
Post Reply

Буцах