Linux 101: My Notes on Users, Permissions, and Getting Things Done
1️⃣ Using Linux, Installing Programs
2️⃣ Using Commands
Using Linux, Installing Programs
1. Getting Started
When Linux starts, a login screen appears. Entering the login details used during initial setup and pressing Enter will prompt for a password. The password is not displayed on screen. In the case of Ubuntu, information such as the kernel version and current system status is shown. This information cannot be changed by the user.
In Linux/Unix, uppercase and lowercase letters are treated differently. Additionally, the number 0, the letter O, the number 1, the pipe symbol |, lowercase l, and uppercase I all look similar but are different characters. The same applies to the backtick ` and the single quote '. Furthermore, computers convert human-readable characters into numbers for processing. The language humans recognize is called a high-level language, while the language machines recognize is called a low-level language. Humans interpret symbols based on their everyday meaning, whereas computers convert them into numbers. For example, the letter A (a) that humans recognize is converted by computers to 65 and 97 respectively in ASCII code.
Linux/Unix Accounts: Groups and Users Linux is an environment where multiple people can use a single computer simultaneously. Those users may be team members or administrators, making it crucial to manage who is allowed to do what. The units used to manage this are users and groups. A user is simply a single login account. An account is required to access the system, and permissions are granted accordingly. Individual permissions can be assigned directly to a user, and these take priority over group permissions. For example, even if a group is blocked from accessing file A, if user kim is granted access directly, kim can still access it. A group is a unit for managing permissions by bundling users together. A single user can belong to multiple groups simultaneously. A group itself cannot execute anything or log in; there must be a user within it for it to have any meaning. As an analogy, a group is like a "type of access pass" and a user is "the person holding that pass." The pass itself does not open the door. When a new account is created, a group with the same name is automatically created alongside it. Create account 'kim' → User 'kim' is created → Group 'kim' is also automatically created The permission priority is as follows: individual (user) permissions take precedence over group permissions. Permissions can be assigned to groups in bulk, and individual permissions can override them when exceptions are needed.
root root is the superuser account with full administrative privileges over the entire system. Every file can be read, modified, and deleted, every setting can be changed, and other user accounts can be created or removed. Because the name "root" is publicly known and identical across every Linux system in the world, it is the primary target for hacking. Distributions like Ubuntu block direct root login by default and use the sudo command instead. Root login can be enabled for convenience, but doing so exposes the system to hacking. The root user's home directory is located at /root. It is important to be aware of the dual meaning of the term "root directory". It can refer to the root account's home directory, but it can also refer to the top-level directory of the entire filesystem, /.
sudo sudo is not available to everyone; only users who have been granted the permission can use it. The account created during the initial installation of Linux is automatically granted sudo privileges, but accounts created afterward do not have sudo access by default and must be explicitly granted it by an administrator. The users who can use sudo and the scope of their access are managed in a file called /etc/sudoers. This file allows fine-grained control over which users can run sudo and which specific commands they are permitted to execute. An important point here is that having sudo privileges does not mean inheriting all of root's permissions. Logging in directly as root grants full access to all system privileges, whereas sudo allows only the permissions explicitly defined in /etc/sudoers. In other words, sudo is not a system that copies the entire set of root's keys; it lends only the specific keys needed for a given situation.
Prompt: The prompt is the text displayed at the beginning of the line in the terminal where commands are entered. Its basic format is username@computername:directory\(, and this single line contains everything about who the current user is, where they are, and what permissions they hold. The username is the name of the account currently logged in. Since Linux allows switching to a different account during use; including switching to root if the user has the necessary permissions and knows the password, the current username is always displayed in the prompt so it is immediately clear who is performing actions. The computer name is the name of the machine currently connected to, displayed to distinguish which computer is being used when remotely connected to another machine. The directory indicates the current working folder, where ~ is a special symbol representing the logged-in user's home directory. For example, the home directory of the account test is /home/test, which is abbreviated as . The symbol at the very end of the prompt indicates the current permission level. # is displayed when the user has root privileges, and \) is displayed for regular users. The specific symbol may vary depending on the shell being used, but Ubuntu uses \( by default. For example, if the terminal displays test@test:\), the currently logged-in user is test, the connected computer name is also test, the current location is test's home directory, and the $ symbol confirms regular user privileges. If the user switches to root, the prompt changes to root@test:~#, with both the username and the trailing symbol changing simultaneously, making the privilege change immediately visible.
Logging Out (logout, exit) Linux/Unix systems are rarely powered off and are often running 24 hours a day. Because multiple users can use the system simultaneously, shutting down after one user finishes would inconvenience others still using it. However, when an administrator needs to stop the operating system, commands such as shutdown and poweroff are used. These commands can only be executed with root privileges. logout and exit terminate only the current user's session visible on screen, whereas shutdown and poweroff bring the entire system down, making it completely inaccessible.
Adding and Deleting Accounts: Accounts are added using useradd and deleted using userdel. However, these commands only perform basic operations; meaning they do not automatically create a home directory or password for the account. A home directory does not refer to the /home folder itself, but rather to the personal space represented by ~ for each account. While a personal computer is typically owned and used entirely by one person, Linux/Unix is designed for multiple users to use a single system simultaneously, so storage space is divided and shared among users. The personal space allocated to each account is what is referred to as a home directory. Therefore, an account's home directory means the personal space where that account can store and use files, which is a different concept from the /home directory where all users' home directories are collectively stored. This distinction is important to keep in mind. There are also adduser and deluser commands, which must be separately installed as they are not built into the operating system. Unlike useradd and userdel, these include additional functionality such as prompting for a password during account creation.
Built-in Manual Linux/Unix provides a built-in manual that can be accessed by typing commands directly in the terminal. It is not included by default due to storage constraints and must be installed separately. The manual is divided into sections numbered 1 through 9, each covering a different type of content such as commands, system calls, and configuration files. The section numbers do not need to be memorized as they can be looked up easily when needed.
2. Copying and Installation
Copying vs. Installing Copying is simply placing identical content in a different location, much like photocopying a document. The content is the same, but the copy may not be usable depending on the computer environment. Installing goes beyond copying by performing additional procedures; it makes the software usable in the new environment by supplementing what is missing and incorporating information specific to the installation location.
The limitations of copying can be understood through an analogy. If a wireless internet device used at home is physically moved to an office, it may or may not work, because the device was configured for the home internet connection and only the location has changed. The same applies to software: copying source code to a new location does not mean it can be run immediately.
The process from copying to execution is as follows: the source code is copied, a compiler and libraries are installed separately, paths and linked files are configured for the environment, and only after all of these steps can the executable (binary file) be run.
Installation automatically handles all the steps required to make software usable anywhere. Returning to the earlier analogy, it is like pulling a dedicated line within the office building and performing a proper installation.
The installation process works as follows: the executable (binary file) is automatically copied to the appropriate location, and a script for environment configuration; including path assignment and linked file specification - is executed automatically, leaving the software ready to use immediately.
In summary, copying is the act of moving files, while installing is the process of automatically performing all the necessary configurations and procedures to make the software actually function in that environment. This is why simply copying a program is not sufficient, and depending on the purpose, the process is divided into full installation and simply copying the executable file.
3. Program
How to Use apt When installing a program in Ubuntu, the following command is used. linux@linux:~$ sudo apt install openssh-server Running this command first prompts for the sudo password, which is the password set when the account was first created. Once the password is entered, the installation proceeds. At this point, apt does not simply install openssh-server alone - it automatically installs all the libraries and additional programs required for that program to function. At the end of the installation process, a [Y/N] prompt appears asking for confirmation of these additional installations.
In other words, apt is a tool that installs all the files and libraries needed to use a program in a single operation. Taking openssh-server as an example, there are multiple dependency files required to run this program, and rather than the user having to find and install each one individually, apt identifies and installs them all at once.
Package List Management: apt retrieves packages by referencing package repository information. On Ubuntu, the files /etc/apt/sources.list and /etc/apt/sources.list.d/ubuntu.sources store repository information, and apt uses this to fetch the required packages from those repositories. The version information in the repository list can be updated with the sudo apt update command. It is important to distinguish between types of updates: the update prompted by the system at first login is related to critical security patches from the operating system's perspective, whereas the update performed manually with sudo apt update refreshes the version information of the package list. Since not everything needs to be kept up to date at all times, updates can be performed selectively as needed. apt is a program that manages the installation and removal of software on Debian-based Linux distributions.
Installing a Package; sudo apt install package-name
Removing a Package: sudo apt remove package-name.. If it is necessary to also delete files created during the installation of a package,
purge is used instead of remove. sudo apt purge package-name The difference between remove and purge is that remove deletes only the package itself, while purge deletes both the package and all associated files created during installation. Upgrading a Package To upgrade installed packages to the latest version, the following two commands are executed in order.
sudo apt update / sudo apt upgrade: apt update first refreshes the version information in the package list, after which apt upgrade upgrades the actual packages to their latest versions.
5. How to use dpkg
While apt automatically manages everything required for installation, dpkg is a tool that installs only a single package bundle. Unlike apt, it does not automatically install dependent libraries or additional programs - it processes only the one specified package. It is important not to confuse dpkg with compression. Compression bundles multiple files together for the purpose of transfer or storage. dpkg, on the other hand, manages files necessary for running a program as a single package unit. The fundamental difference is that dpkg manages units of executable programs, not simple file bundles.
Using Commands
passwd
The passwd command is used to change the password of an account. When the prompt displays linux@linux:~$, the account name to be changed corresponds to the first linux at the very beginning of the prompt.
whoami
There are situations where it is necessary to confirm which account is currently being used when executing commands. One such example is when an administrator connects as a regular user in order to provide technical support. Running the whoami command immediately displays the name of the account currently in use.
id
Running the id command outputs more detailed information compared to whoami. It displays comprehensive information about the currently active account, including user and group data. The numbers shown in the output are important, as files are represented by numbers during the process of copying and moving them.
who
The who command displays a list of accounts currently logged into the system. On a personal Ubuntu Linux system used by a single person, only one account will be shown. However, if multiple accounts are logged in simultaneously or multiple terminals are open, all logged-in accounts will be listed.
The output of the who command also includes an item indicating the method of login, which is divided into two types. tty (teletypewriter) refers to a direct physical connection, while pts (pseudo-terminal slave) refers to a virtual connection. In other words, if the user is sitting directly in front of the computer, the connection is shown as tty, and if connected remotely, it is shown as pts.
w
The w command shows what is currently happening on the system. The output is displayed in the following format.
13:12:33 up 21min, 2 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
The current time, system uptime, number of logged-in users, and system load average are all displayed on a single line. Below that, detailed information for each logged-in account is listed. jcpu refers to the total CPU time used by all processes running under that account, while pcpu refers to the CPU time used by the process currently shown in the what column.
These commands do not need to be memorized in detail. Simply knowing that they exist is enough, as they can easily be looked up through a search when needed.
date
Running the date command outputs the time configured on the system. An important point to note is that this time does not necessarily match the actual real-world time. Since the output reflects the time set on the system, it may differ from the actual time if a user has manually changed it. This works the same way as the time settings on a mobile phone; it can be set to automatically sync with the current time, or manually configured to a desired time by the user.
touch
The touch command updates the access time and modification time of a file to the current time. Options that begin with - are called flags. The main flags available for touch are as follows.
-t is used to change the time to a user-specified time rather than the current time. -m changes only the modification time of the file. -a changes only the access time of the file.
Detailed descriptions of each flag can be found in the built-in manual using man touch, or through external websites. There is no need to memorize the specific options - they can be looked up and applied as needed.
printenv, env
printenv and env are commands used to check what environment the computer is currently operating in. Running either command outputs the current environment information, and it is also possible to hide an ID or change a group for security purposes. The env command is used in the following format.
linux@linux:~$ env [NAME=VALUE] ... [COMMAND [ARG] ...]
This sets the environment variable specified by NAME to the value of VALUE and then executes COMMAND. In other words, rather than permanently changing the entire system environment, it applies the specified environment value only for the duration of that particular command execution.
ls
ls is the most commonly used command for files and directories, displaying the contents of the current directory. A variety of flags can be used alongside it.
Running ls -F appends an indicator to each file name to show the type of file. Running ls without -F displays only the file names without any indicators.
The reason indicators were introduced is that when ls first appeared, color display was not supported and output was shown in a single color, making it difficult to distinguish file types. Color support is now standard, so indicators are no longer strictly necessary, but the feature is maintained because some users still rely on it and there is no reason to remove it. Preserving existing functionality for the sake of compatibility is a general principle in computing.
. and ..
. refers to the current directory, while .. is a relative notation referring to the directory one level above the current directory.
Permissions and File Types
Running ls -lh /etc outputs detailed information about files and directories. The character displayed at the very beginning of each line indicates the type of file. d indicates a directory, l (lowercase L) indicates a symbolic link, and - indicates a regular file. For a simple view, ls -F can be used, and for a detailed view, ls -lh is the appropriate option.
Permissions are divided among four targets: u for the owner (user), g for the group, o for others, and a for all.
When a file's permissions are displayed as drwxr-xr-x, the leading d indicates the file type, and the remaining characters are read in groups of three.
rwx / r-x / r-x
u g o
The meaning of each character is as follows: r means read permission (4), w means write permission (2), and x means execute permission (1).
In binary notation, the values corresponding to r, w, and x are 4, 2, and 1 respectively. Permissions can be set by specifying the sum of these values.
Full permission : 4+2+1 = 7 → rwx
Read/Write only : 4+2 = 6 → rw-
Read only : 4 = 4 → r--
For example, setting permissions to 644 results in rw-r--r--, and setting them to 777 results in rwxrwxrwx. More complex administrator-level permission features also exist using s and t, but at this stage it is sufficient to simply be aware that such features exist.
pwd
The pwd command displays the current working directory. When permissions are frequently changed or tasks accumulate, it can become easy to lose track of the current location. In practice, pwd is used frequently.
cd
The cd command is used to navigate between directories. cd . moves to the current directory, meaning the location does not change. cd .. moves one level up to the parent directory. cd ~ moves to the home directory of the currently logged-in user.
The reason ~ is used is that it allows relative path expression. For example, to navigate to the bin directory under a specific user's home directory, cd ~/bin can be used. Without ~, the full path such as cd /home/linux/bin would need to be typed out each time. When there are many users across various environments, each user's home directory path is different, making absolute paths impractical. Using ~/bin universally implies each user's own bin directory under their respective home directory, which is why ~ is an essential notation.
du
While Windows and Mac allow users to easily check storage usage through a file explorer, Linux Ubuntu uses the du command for this purpose. du stands for disk usage and shows how much disk space the current directory or file occupies.
df
The df command is used to check how much of the filesystem is being used. For example, if a 1TB disk is installed and 200GB is in use, the remaining 800GB will not be shown unless it has been mounted. A volume must be mounted before it can be recognized and used by the system.
The main flags are as follows: -a displays all filesystems including all types, and -h displays file sizes in a human-readable format. For example, using the -h option outputs sizes in units such as KB, MB, and GB instead of bytes.
mkdir, rmdir
mkdir is used to create a directory.
rmdir is used to delete a directory. Adding the -p flag allows deletion of both parent and child directories simultaneously.
cp
The cp command is used to copy files, creating an exact duplicate of the original. When copying, there are important points to note regarding file names. If the files are in different directories, the original and the copy may share the same name. However, within the same directory, two files cannot have the same name, so the copy must be given a different name. If a file with the same name already exists in the destination directory - for example, when copying a src file to a dst file and a file named dst already exists, the system will ask whether to overwrite it. This is an area that requires particular care when using Linux. Windows and Mac display overwrite warnings by default, whereas Linux may overwrite without warning depending on the settings. There is a difference in terms of efficiency, but it is important to judge which approach is more appropriate depending on the situation.
mv
The mv command is used to move a file or directory from its current location to another. If the destination is a different directory, the file is fully moved to that location. If used within the same directory, it can also serve as a way to rename a file without actually moving it.
rm
Directories can be deleted using rmdir. The rm command is also used for deletion.
chown, chmod
chown is used to change the owner of a file or directory. For example, it can be used to change the owner from root to test, or from test to root. Because this involves changing ownership, the user must have the appropriate permissions to execute it.
chmod is used to change the execution permissions of a file or directory. Permissions can be set using either the numeric method or the rwx character method. The symbols used in the character method have the following meanings: + adds a permission, - removes a permission, and = assigns only the specified permissions while removing any that are not explicitly stated. For example, u+rw means adding read (r) and write (w) permissions to the owner (u).
Summary
Linux is an environment where multiple users can work simultaneously, making permission management critically important. Because root holds full control over the entire system, a successful attack could expose everything, resulting in a serious security breach. Anyone in a position to manage root privileges must always be aware of the responsibility that comes with it.
When copying or moving files, it is essential to develop the habit of verifying whether overwriting an existing file is intentional. Accidental overwrites are often difficult or impossible to undo.
There are multiple ways to install programs. While it is possible to compile source code directly and copy it, this approach is difficult to manage and time-consuming. For this reason, Ubuntu primarily uses package management tools such as apt and dpkg. Among these, apt is the most widely used. At this stage, it is sufficient to know the names of packages and how to perform updates.



