What is Linux

Linux is an open source operating system

File System Hierarchy

Path Description
/ The root (/) holds essential boot files and mounts all other filesystems as subdirectories.
/bin Contains essential command binaries.
/boot Consists of the static bootloader, kernel executable, and files required to boot the Linux OS.
/dev Contains device files to facilitate access to every hardware device attached to the system.
/etc Local system configuration files. Configuration files for installed applications may be saved here as well.
/lib Shared library files that are required for system boot
/media External removable media devices such as USB drives are mounted here.
/home Each user on the system has a subdirectory here for storage.
/usr Contains executables, libraries, man files, etc.
/tmp The operating system and many programs use this directory to store temporary files. This directory is generally cleared upon system boot and may be deleted at other times without any warning.
/sbin This directory contains executables used for system administration (binary system files).
/root The home directory for the root user.
/opt Optional files such as third-party tools can be saved here.
/mnt Temporary mount point for regular filesystems.
/var This directory contains variable data files such as log files, email in-boxes, web application related files, cron files, and more.

Terminal

Terminal is a command line application to tell our linux system what do we need, heres how it looks like:

┌──(user㉿linux)-[~] └─$

(user㉿linux)

(user㉿linux) user is gonna be your user and linux is gonna be your hostname

ls

ls stand for list this is going to list the directory you are in

┌──(user㉿linux)-[~] └─$ ls Applications Downloads Pictures Desktop Music Templates Documents Public Videos

cd

cd stand for change directory use this command to change directory, Here is an example:

┌──(user㉿linux)-[~] └─$ cd Documents ┌──(user㉿linux)-[~/Documents] └─$

..

.. will make you go back in directory

┌──(user㉿linux)-[~] └─$ cd Documents ┌──(user㉿linux)-[~/Documents] └─$ cd .. ┌──(user㉿linux)-[~] └─$

mkdir

mkdir stand for make directory this will make a folder

┌──(user㉿linux)-[~/Documents] └─$ mkdir Folder ┌──(user㉿linux)-[~/Documents] └─$ ls python html Pictures help Folder

rm

rm stand for remove this will delete the file you choose

┌──(user㉿linux)-[~] └─$ls Applications Downloads Pictures Desktop Music Templates Documents Public Videos Deleteme.txt ┌──(user㉿linux)-[~] └─$rm Deleteme.txt ┌──(user㉿linux)-[~] └─$ls Applications Downloads Pictures Desktop Music Templates Documents Public Videos

exit

exit will exit

which

which this command will tell you where is this command stored

┌──(user㉿linux)-[~] └─$ which rm /usr/bin/rm

sudo

sudo allows users to run commands with privileges that only root user have

┌──(user㉿linux)-[~] └─$sudo rm admin.png [sudo] password for user:

ps

ps Shows process status.

┌──(user㉿linux)-[~] └─$sudo ps PID TTY TIME CMD 14032 pts/0 00:00:00 zsh 14212 pts/0 00:00:00 ps

who

who Shows who logged in

┌──(user㉿linux)-[~] └─$sudo who user

lsblk

lsblk Lists block devices

┌──(user㉿linux)-[~] └─$sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 931.5G 0 disk nvme0n1 259:0 0 232.9G 0 disk

man "tool"

man Opens man pages for the specified tool

┌──(user㉿linux)-[~] └─$sudo man ls

apropos "keyword"

apropos Opens man pages for the specified tool

┌──(user㉿linux)-[~] └─$apropos google chromium (1) - the web browser from Google

cat

cat print files

┌──(user㉿linux)-[~] └─$cat cats.txt mew :3

cat

whoami Display who are you

┌──(user㉿linux)-[~] └─$whoami user

hostname

hostname Display your hostname

┌──(user㉿linux)-[~] └─$hostname linux

pwd

pwd Display your current directory

┌──(user㉿linux)-[~] └─$pwd linux

ifconifg

ifconfig The ifconfig utility is used to assign or view an address to a network interface and/or configure network interface parameters.

┌──(user㉿linux)-[~] └─$ifconifg

ip

ip Ip is a utility to show or manipulate routing, network devices, interfaces,

and tunnels. ┌──(user㉿linux)-[~] └─$ip

ss

ss utility to investigate sockets.

┌──(user㉿linux)-[~] └─$ss

netstat

netstatDisplay network status.

┌──(user㉿linux)-[~] └─$netstat

lsusb

lsusb Lists USB devices.

┌──(user㉿linux)-[~] └─$lsusb Bus 001 Device 002: ID 1532:008a Razer USA, Ltd RZ01-0325, Gaming Mouse [Viper Mini]

su

su change from user to user

┌──(user㉿linux)-[~] └─$ sudo su root password: ┌──(root㉿linux)-[/home/user] └─# Bus 001 Device 002: ID 1532:008a Razer USA, Ltd RZ01-0325, Gaming Mouse [Viper Mini]

useradd

useradd "user" Add user

┌──(user㉿linux)-[~] └─$useradd batman

usermod

usermod "user" mod a user

┌──(user㉿linux)-[~] └─$usermod batman

userdel

userdel "user" delete a user

┌──(user㉿linux)-[~] └─$userdel batman

addgroup

addgroup "group" add a group to the system

┌──(user㉿linux)-[~] └─$addgroup super_heros

delgroup

delgroup "group" delete a group from the system

┌──(user㉿linux)-[~] └─$delgroup super_heros

passwd

passwd "user" "password" Chnage user password

┌──(user㉿linux)-[~] └─$passwd batman 1234

dpkg

dpkg Install or remove and configure .deb packages

┌──(user㉿linux)-[~] └─$dpkg install chrome.deb

apt

apt High-level package management command-line utility

┌──(user㉿linux)-[~] └─$sudo apt install firefox

snap

snap same as apt but different

┌──(user㉿linux)-[~] └─$sudo snap firefox

systemctl

systemctl system services maneger

┌──(user㉿linux)-[~] └─$systemctl --help

kill

kill any service

┌──(user㉿linux)-[~] └─$kill chrome.exe

bg

bg stand for background puts any prosses in the background

┌──(user㉿linux)-[~] └─$bg ping google.com

fg

fg stand for frontground puts any prosses in the frontground

┌──(user㉿linux)-[~] └─$fg ping google.com

jobs

jobs Lists all processes that are running in the background

┌──(user㉿linux)-[~] └─$jobs

curl

curl Command-line utility to transfer data from or to a server

┌──(user㉿linux)-[~] └─$curl 192.168.1.121/nc.exe

clear

clear the Terminal

┌──(user㉿linux)-[~] └─$clear

touch

touch Create an empty file

┌──(user㉿linux)-[~] └─$touch fire.txt

tree

tree show files in a tree way

┌──(user㉿linux)-[~] └─$tree ├── python │   ├── data.py │   ├── Login.py │   ├── Mikustore.py │   ├── ping.py │   ├── __pycache__ │   │   └── ping.cpython-312.pyc │   ├── store.py │   └── ur ip.py └── windows 11 └── Win11_24H2_EnglishInternational_x64.iso

mv

mv mv stand for move this will move files

┌──(user㉿linux)-[~] └─$mv password.txt home/Documents/myfolder

cp

cp mv stand for copy this will copy files

┌──(user㉿linux)-[~] └─$cp password.txt home/Documents/myfolder

find

find this will find any file you wish

┌──(user㉿linux)-[~] └─$find -name password.txt

nano

nano is a Terminal text editor

┌──(user㉿linux)-[~] └─$nano password.txt

locate

locate this will locate databases from the system

┌──(user㉿linux)-[~] └─$locate nc.exe

grep

grep Searches for specific results that contain given patterns.

┌──(user㉿linux)-[~] └─$ systemctl status | grep apache2 │ │ └─5995 grep --color=auto apache2

Blog

Trying My Best in cybersecurity, tutorials, and more!