-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__Main__--Linux--File_System.html
More file actions
8 lines (8 loc) · 4.51 KB
/
__Main__--Linux--File_System.html
File metadata and controls
8 lines (8 loc) · 4.51 KB
1
2
3
4
5
6
7
8
<!doctype html><html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>File System</title>
<meta name="generator" content="CherryTree">
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body><h2>Overview</h2><br /><br />• Processes communicate via files<br /><br /><div class="codebox"><div class="codebox"><span style="color:#ff9d00;font-weight:700">ps</span> aux <span style="color:#ff9d00;font-weight:700">|</span> <span style="color:#ff9d00;font-weight:700">grep</span> udevd<br /><br /><span style="color:#0088ff;font-weight:400"># To view a list of file system</span><br /><span style="color:#ff9d00;font-weight:700">df</span> -h</div></div><br /><br />• In Ubuntu, you can run ifconfig from any user but not in Debian<br /><br /><div class="codebox"><div class="codebox"><span style="color:#0088ff;font-weight:400"># Examples</span><br /><span style="color:#ff9d00;font-weight:700">/</span>sbin<span style="color:#ff9d00;font-weight:700">/ifconfig</span></div></div><br /><br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /><br /><h2>File System Layout</h2><br />• Important directories for sysadmin<br /> ◇ /etc<br /> ▪ pronouced as “et - c”<br /> ▪ contains configuartion data for applications<br /> - /etc/apt<br /> - /etc/crontab<br /> - /etc/ssh<br /> ◇ /sbin<br /> ▪ contains secured binaries, critical files<br /> ◇ /bin<br /> ▪ contains binaries of the base OS or links to binaries<br /><br />• Others<br /> ◇ /dev<br /> ▪ contains all your devices<br /> ◇ /home<br /> ▪ home for all users that is not root<br /> ◇ /root<br /> ▪ /home directory for root<br /> ◇ /lib<br /> ◇ /lib64<br /> ▪ system libraries (like dll in windows)<br /> ◇ /media<br /> ▪ automatic mount<br /> ◇ /mnt<br /> ▪ manual mount<br /> ◇ /opt<br /> ▪ commercial programs e.g. dropbox<br /> ▪ packages not installed via package manager<br /> ▪ compiled programs<br /> - make a link from /bin to /opt<br /> ◇ /proc<br /> ▪ kernel files (virutal fs)<br /> ▪ one directory for each process running on the machine<br /> ◇ /tmp<br /> ▪ clear when you reboot the machine<br /> ◇ /usr<br /> ▪ /usr/local<br /> - compiled programs<br /> ▪ /usr/sbin<br /> - system admin commands<br /> ▪ /usr/share<br /> - configuration files, themes, icons, wallpapers, sound files<br /> → /usr/share/doc<br /> ⇒ documentation files<br /> → /usr/share/applications<br /> ⇒ .desktop files<br /> ◇ /var<br /> ▪ various files - files that change all the time<br /> ▪ /var/log - log files<br /> ◇ /lost+found<br /> ▪ found in ext4 file system<br /><br /><div class="codebox"><div class="codebox"><span style="color:#0088ff;font-weight:400"># Reference</span><br /><span style="color:#0088ff;font-weight:400"># Descriptions of filesystem hierarchy</span><br /><span style="color:#ff9d00;font-weight:700">man</span> hier</div></div><br /><br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /><br /><h2>File Types</h2><br />• As shown in permission bits from <em>ls</em> command<br /> ◇ ordinary (-)<br /> ◇ links (l)<br /> ◇ directory (d)<br /> ◇ block device (b)<br /> ◇ character device (c)<br /> ◇ named pipes<br /> ◇ local sockets<br /><br /><div class="codebox"><div class="codebox"><span style="color:#ff9d00;font-weight:700">ls</span> -l <span style="color:#ff9d00;font-weight:700">/</span>dev <span style="color:#ff9d00;font-weight:700">|</span> <span style="color:#ff9d00;font-weight:700">grep</span> sd <span style="color:#0088ff;font-weight:400"># show block device files</span><br /><span style="color:#ff9d00;font-weight:700">ls</span> -l <span style="color:#ff9d00;font-weight:700">/</span>dev<span style="color:#ff9d00;font-weight:700">/</span>input<span style="color:#ff9d00;font-weight:700">/</span>mouse0 <span style="color:#0088ff;font-weight:400"># show character device file</span></div></div><br /><br /><br /><p align="center"><img src="images\home.png" height="22" width="22"> <a href="index.html">Index</a></p></body></html>