Personal Blog

This is a personal blog to register my academic journey

This project is maintained by villacisJimmy


layout: post title: “Fundamentals of Linux” date: 2025-08-25 categories: [blog] —

Title

NOTES: INTRODUCTION TO LINUX

CLASS 1

Virtualization → Sharing the resources of a computer.

“For virtualization”

Free Software ≠ Free of Charge

Free Software → Non-proprietary; no authorization or contract is required to acquire or use it.

Distributable → You can make as many copies as you like. It is not allowed to prevent someone else from redistributing it.

Accessible → Source code is available. Encourages the distribution of source code to foster software development.

Modifiable → Programs can be improved and redistributed with modifications.

Reusable → Previously written code can be reused, as long as the new code preserves the freedoms of the original software.

No Guarantees → Functionality is not guaranteed. → Support exists but is different from traditional methods.

Hereditary → Any software derived from free software must also be free (it is forbidden to forbid).

Free Software Foundation (FSF)

FSF’s focus:

GNU’s Not Unix (GNU)

Licensing and Open Source

Copyleft → A method to turn a program into free software and require all versions, modified or extended, to also remain free.

Open Source (a.k.a. Open Code):

Linux and Unix

CLASS 2

Advantages

Disadvantages

Distribution

GNU tools can be freely copied, modified, and installed.

All distributions can use the same kernel, but differ in package managers.

Distribution differences:

VM INSTALLATION - VMware

Enhanced Keyboard Support – For special keys.

Netinstall:

CLASS 3

Installation: Disk or ISO Image

When prompted for the FQDN (Fully Qualified Domain Name):

Partitions and File Systems

Linux minimum partition scheme:

Boot: Stores boot files Swap: Half the size of the RAM Boot size: ~1GB

Linux Directory Tree

The Root user has full privileges.

/ → root
/bin/ → essential binaries
/boot/ → static boot files
/dev/ → device files
/etc/ → system configuration
/home/ → user personal folders
/lib/ → shared libraries and kernel modules
/media/ → mount point for removable media
/mnt/ → temporary mount point
/opt/ → optional software packages
/sbin/ → system binaries
/srv/ → service data
/tmp/ → temporary files
/usr/ → user utilities and apps (subtree includes bin, include, lib, local, sbin, share)
/var/ → variable files
/root/ → root’s personal folder
/proc/ → virtual file system for kernel and process info

Unlike Windows (C:, D:, etc.), Linux uses mount points in a single file system structure.

Multi-user system: multiple users can work at the same time via a GUI or a terminal.

Useful Commands $ df -h # Show partitions $ free -mh # Show memory usage

CLASS 4

$ hostname $ whoami # which user I am using $ su $ ip a # network interfaces $ w # see connected users

/var/log > Logs

What is the shell

Documentation and command help $ man $ –help

alumno@alumno:/var$ (username, machine name, last folder, user type)

Commands

Arguments

Commands can be:

Virtual Consoles

$ kill -9 (PID) -> kill a process, to get the process (top, htop, ps) $ ps -aux

CLASS 5

Absolute path

Output of ls -l: “l” —> symbolic link (shortcut in Windows) “d” is a directory “-” is a file

Relative path

To concatenate 2 commands we use the logical operator && $ cd /boot/ && ls -l

List, concatenate, and filter $ ls -l /etc/ | grep .conf

Files with the extension “.conf” are called daemon files and are configuration files.

List the contents of a directory $ dir

Show the host machine architecture $ arch $ uname -m

Know the kernel we are using $ uname -r $ uname -a

Hardware Components $ dmidecode -q

Redirect

View partitions $ df -h

Disk sector data, read tests $ hdparm -i /dev/sda

Check memory /proc/meminfo

RAM Memory - SWAP $ free -m

List usb $ lsusb

Date $ date

Calendar $ cal

Shut down the system: $ shutdown $ halt $ init 0

Restart the system $ reboot

View files and folders in tree form $ tree

Move and rename $ mv

Create multiple directories hierarchically $ mkdir -p /directory1/directory2/directory3/

Create multiple files $ touch file1.txt file2.txt

Copy multiple files

Wildcard (“.”) replaces destination

$ cp /var/log/ .

E.g., search for any character that represents a digit [0-9]

The hyphen indicates a range of characters

Recursiveness (-r)

Command history $ history

The commands are stored with an identifier number, which allows them to be executed from the console by preceding the symbol “!” with the ID

Clear command history $ history -c

Make a backup of the history and then delete it (Hardening) $ history » /var/log/history_date && history -c

Can be automated with a script and crontab

SAMBA service, file sharing service

Text viewers $ cat “file”

All users created on the system (not system-specific) start from UID 1000

usuario:x:1000:1000:usuario,,,:/home/usuario:/bin/bash

User code UID (usuario:x:1000) Group code GID (1000:usuario) User’s main folder (/home/usuario)

Groups containing users /etc/group

Create user $ useradd $ adduser (asks for password) (generates more configuration)

Create password $ passwd “user”

Delete user $ userdel “user”

DNS information /etc/resolv.conf

.sh extension

Executable scripts (./script)

Permission structure

Apply to files and directories that are associated with users or groups, and can be for reading, writing, or execution

Permission structure

Permission administration

Permissions

File type / Owner / Group / Others

These 3 permissions can be assigned to the following 4 categories u - Owner: owner of the file or directory g - Group: group to which the file or directory belongs o - Others: all other users who are neither the owner nor belong to the group a - All: includes owner, group, and others

Change Permissions $ chmod (category) (+ to add) (- to remove) “file”

Octal Notation rwx = 7

r = 4 w = 2 x = 1

$ chmod 777 “file”

Change ownership $ chown

To change the owner and group of a file, just use: $ chown user:group “file”

$ chown alumno:alumno “file”

BASH

#!/bin/bash (to start)

25 August 2025 [J x 2]


← Volver al inicio