Ubuntu Tutorial

Directory Properties : open file explorer and select directory > right click and select "properties" or use shortcut ctrl + i

Basic properties shows directory name, type, content(total items and human readable size) parent folder/directory path, last modified time, free space. Permissions properties shows Owner Permissions, Group Permissions, Other Permissions. and Local Network share properties shows share folder/directory properties.

image
directory properties

Apparent Size : Filesystem store data in block format. apparent size is the amount of space taken in the last block. In most cases, the apparent size is smaller than the disk usage because the disk usage counts the full size of the last (partial) block of the file, and apparent size only counts the data that's in that last block. However, apparent size may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks,...

Disk Usage : Filesystem store data in block format. . it is the total amount of space taken by blocks on hard drive. block takes apparent size and some reserved size (free space). reserved size is used when we add data to file.

du command : The du (disk usage) command print disk usage(amount of space taken on hard drive) of each file or directories. it will print all directories including hidden directories with respective size (in kilobyte), and in the end of output total size (in kilobyte) taken by current directory(represented as dot character).

syntax : du options file/directory/path

image
du command

following table shows options for du command.

Options Description
-0 or --null does not print output on new line
-a or --all print all(-a) files and directories
--apparent-size print apparent-size for given directory or file
-c or --total print total size as total at the end of output
-d N or --max-depth=N print specified number of directory depth
-h or --human-readable print size in human(-h) readable format
-S, --separate-dirs do not include size of subdirectories(-S)
-s print only summary(-s) or total size for directory or file.
-t N or --threshold=SIZE exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative
--time show time of the last modification of any file in the directory, or any of its subdirectories
--exclude=PATTERN exclude files that match PATTERN

Directory Permissions : chmod command is used to add or remove permission for files or directories. be careful when executing chmod command.

syntax : chmod permission file/directory

permission can be given as read(r),write(w) and execute(x) to user(u),group(g) and other(o). to add permission + is used and to remove permission - is used. following are examples.

Command Description
chmod u+r js add read permission to user for js directory
chmod u+w js add write permission to user for js directory
chmod u+x js add execute permission to user for js directory
chmod u-r js remove read permission from user for js directory
chmod u-w js remove write permission from user for js directory
chmod u-x js remove execute permission from user for js directory
chmod g+r js add read permission to group for js directory
chmod g+w js add write permission to group for js directory
chmod g+x js add execute permission to group for js directory
chmod g-r js remove read permission from group for js directory
chmod g-w js remove write permission from group for js directory
chmod g-x js remove execute permission from group for js directory
chmod o+r js add read permission to others for js directory
chmod o+w js add write permission to others for js directory
chmod o+x js add execute permission to others for js directory
chmod o-r js remove read permission from others for js directory
chmod o-w js remove write permission from others for js directory
chmod o-x js remove execute permission from others for js directory