LINUX Flashcards
The ‘ls’ command
“list files as specified”
Lists files in a directory, often used to navigate the file system.
Syntax: ls [option] [file/directory]
Common options:
-d → ‘directories only’, List directories themselves, rather than their contents.
-l → ‘long format’, provides more detail
-a → ‘show all’ (including hidden files)
-t → ‘time sorted’, Displays the most recently modified files first
-r → ‘reversed order’, Displays files first in reverse order from default order
-S → ‘Size order’, Displays files largest to smallest
-R → ‘recursive display’, List files and directories recursively (including subdirectories)
-i → ‘inode’, Displays the index number of each file/directory
-g → ‘group’, displays the group ownership of files and directories instead of the owner
-h → ‘human readable’, Print file sizes in human-readable format (e.g., 1K, 234M, 2G).
Lists files in a directory, often used to navigate the file system.
Syntax: ls [option] [file/directory]
Change the current directory
Syntax: cd [directory]
Tips:
1) “cd /” takes you back to the root
2) “cd ~” takes you back to the home
3) “cd .. “ takes you one level ‘up’ from the current working directory
If you’re already in the parent directory of the target, you do not need to include the full path name in the [directory] input -just enter the path from your working directory to your target.
Display currently running processes
Use the ‘ps’ command.
This is useful for monitoring system activity.
Output is in four columns:
PID – the unique process ID TTY – terminal type that the user is logged into TIME – amount of CPU in minutes and seconds that the process has been running CMD – name of the command that launched the process.
Syntax: ps [options]
Available options:
a → List all ruining processes for all users
-A, -e → Lists all processes on the entire system, complete overview of running tasks and programs.
-a → List all processes except session leaders (instances where the process ID is the same as the session ID) and processes not associated with a terminal.
-d → Lists all processes except session leaders, providing a filtered view of processes running on the system.
–deselect, -N → Lists all processes except those that meet specific user-defined conditions.
f → Displays the hierarchy of processes in a visual ASCII art format, illustrating parent-child relationships.
-j → Presents the output in the jobs format, providing detailed information such as process ID, session ID, and command.
T → Lists all processes associated with the current terminal, aiding in focusing on tasks related to a specific terminal.
r → Only lists running processes, useful for monitoring system performance.
u → Expands the output to include additional information like CPU and memory usage.
-u → Specifies a username, listing processes associated with that user.
x → Specifies a username, listing processes associated with that user.
Motivation, Basis, & Influences (Linux)
Invented in 1991 by Linus Torvalds
Linus wanted to create an alternative to MINIX MINIX was an expensive proprietary OS Linus' goals: Open source Extensible/Modifiable Community Driven
Early development (Linux)
Linus posted about it on the MINIX server, explaining that it was “just a hobby” (no one knew how big/popular it was going to end up being)
Originally called Freax (pronounced "Freaks") Renamed after one of Linus' friends uploaded code to their FTP server in a file called "Linux" What Linus actually built was pretty basic (built on a simple Kernel) Linus collaborated with Richard Stallman on the GNU project to fill in a lot of the gaps Because people kept adding to it, the use cases just kept adding up
Linux’s role in historically significant projects
A critical part of FAANG (specifically Google, Amazon, and Facebook)
Plus it's the foundation of Android Played a role in the development of the internet and cloud computing
Linux Strengths
Stable
Good Security High Performance Versatile (from a hardware perspective)
Linux weaknesses
Unintuitive: Steep learning curve
Limited compatibility with proprietary software and drivers
Linux Value/Application
The “preferred” Platform of developers (since it is so flexible and has an insane number of libraries)
It's used in pretty much everything