家目錄(Home directories)

使用者的個人檔案通常都會在/home(一般使用者)或是/root(超級使用者),你的家目錄位於/home/<your-username> (/home/mt, /home/john, etc.)。以下為幾種查看家目錄的方法:



echo $HOME /home/mt ⤍ echo ~ /home/mt ⤍ echo ~/Documents /home/mt/Documents
Code language: Bash (bash)


cd ~john ⤍ pwd /home/john
Code language: Bash (bash)

系統目錄(System directories)




/usr/local/ share/ emacs --------- ----- ----- Scope Category App
Code language: plaintext (plaintext)


/ System files supplied with Linux. /usr More system files supplied with Linux. /usr/local System files developed "locally," either your organization or your individual computer. /usr/games Games.
Code language: plaintext (plaintext)


bin Programs (usually binary files). sbin Programs (usually binary files) intended to be run by the superuser. lib Libraries of code used by programs. doc Documentation. info Documentation files for emacs's built-in help system. man Documentation files (manual pages) displayed by the man program; the files are often compressed and are sprinkled with typesetting commands for man to interpret. share Program-specific files, such as examples and installation instructions. etc Configuration files for the system (and other miscellaneous stuff). init.d Configuration files for booting Linux. rc.d Configuration files for booting Linux; also rc1.d, rc2.d, ... include Header files for programming. src Source code for programs. cgi-bin Scripts/programs that run on web pages. html Web pages. public_html Web pages, typically in users' home directories. www Web pages. fonts Fonts. X11 X window system files. dev Device files for interfacing with disks and other hardware. media Mount points: directories that provide access to disks. mnt Mount points: directories that provide access to disks. var File specific to this computer, created and updated as the computer runs. lock Lock files, created by programs to say, "I am running"; the existence of a lock file may prevent another program, or another instance of the same program, from running or performing an action. log Log files that track important system events, containing error, warning, and informational messages. mail Mailboxes for incoming mail. run PID files, which contain the IDs of running processes; these files are often consulted to track or kill particular processes. spool Files queued or in transit, such as outgoing email, print jobs, and scheduled jobs. tmp Temporary storage for programs and/or people to use. proc Operating system state.
Code language: plaintext (plaintext)

檔案權限(File permissions)



⤍ ls -l file -rw-r--r-- 1 mt eecsmt 2048 Oct 18 2020 file
Code language: Bash (bash)


⤍ ls -ld dir drwxr-x--- 2 mt eecsmt 4096 Mar 20 2019 dir
Code language: Bash (bash)


Code language: Bash (bash)


Position Meaning 1 File type: - = file, d = directory, l = symbolic link, p = named pipe, c = character device, b = block device. 2-4 Read, write, and execute permissions for the file's owner. 5-7 Read, write, and execute permissions for the file's group. 8-10 Read, write, and execute permissions for all other users.
Code language: plaintext (plaintext)