Escolar Documentos
Profissional Documentos
Cultura Documentos
/dev/-----: The folder containing files that are the pointers to devices.
lsmod: shows the active modules installed on the system
modprobe: instert a module into the system.
RAID vs LVM:
RAID:Redundant Array of Independents Disks.
LVM: Logical Volume Manager. It can combines Drives to appear as one logical space agregating
volume.
Using APT:
APT: Manager used to install software for debian distributions (Ubuntu)
/etc/apt/sources.list: contain the information about the repositeries to be used
/etc/apt/sources.list.d/: contain the repositeries listed i separated files.
apt-get : commande to interact with packages
update : update the cache of the information repository
upgrade: upgrade ths system except the kernel
dist-upgrade: upgrate everything including the kernel
install :install a specific package
remove: remove a specific package
purge: remove a package and its configuration file
apt-cache: gives information about packages
search :information for a specific term
show: details on specific package
aptitude: alternative command use for apt management
search
show
install
safe-upgrade
dpkg-reconfigure : to recunfigure installed packages on the system.
Manipulate Text:
head: show the first few lines of a text file.(normally the first 10 lines)
-n: for specifying the number of lines.
tail: show the last few lines of a text file. Often used for viewing log files.(normally the last 10
lines)
-n :for specifying the number of lines.
cat: concatenate and display different files. Often used to display files.
split: divide one text file into multiple files
-l : spcify the number of lines into each new created file.
paste: merge data from different files side by side horizontally
join: merge data from different files combing a specific parameters (number for example)
(communality should be find between lines so that it will apear)
expand : converts "tab" into spaces.
unexpand -a :convert spaces into the "tab"
sed: stream editor, used to substitute, nest and simple regex
1 sed 's/this/that/g' file.txt'
s--> for substitute
this--> the text to replace
that--> the text to be replaced with
g--> global , to keep searching through each line.
File Management:
pwd: presents actual working directory
"." : shortcut signifing the current directory.
".." : shortcut for the folder above.
~ : shortcut to the home directory of the connected user.
ls : listing the contents of a folder
-R : shows recursively the content of each sub-folder.
-l : show long listing
-a : showing even hidden files or folders
.file: makes the file hidden by adding the "." at the start.
touch: creates empty file, or update time stamp.
rm : remove files (or folders for a recursive use)
-rf: recursive and force the hidde file.
mv: moves files or folders, used to rename .
cp : copy files ( or folders for a recursive use)
-R :to copy a folder withs whole contents.
mkdir: make folder.
rmdir: removes folders that are already empty
Find Command:
find :look for a file or a directory on the system :
find <location> options... -exec commands
- type d/f (directory or file)
- name (file name)
- iname (case insensitive name)
- mtime (modified in last x days)
- mtime +/- (more than /less than days)
-cmin -60 ( changed in lat 60 minutes)
- size +S : for size criteria
Process Priorities:
Nice-level/ Priority level : define the much of the time cpu to use by a process. The Nice level is
defined as following:
-20 : The highest Priority level
0: the Default level
19: The lowest priority level
nice : specify the priority level to launch an application :
nice -l application: l defines the level (from -20 to 19)
ps -alf : to show processes with priorities
renice : this command change the priority o already running process
renice l -p PID
GPT vs MBR:
MBR(Master boot record): a part o the hard drive that describe its content (partitions
informations). It resides on the first sector of the drive.(2TB max of HD and 4 partitions)
GPT (GUID (Global unique identifier) Partition Table): Same as MBR but stored in multiple
locations , with unlimited number of parttions per hard drive
PS: Each parttion is named in system as sda
fdisk: a tool used to format Hard drives, and make partitions. with MBR mode
gdisk : a tool used to format Hard drives, and make partitions. with GPT mode
Drive Quotas :
Setting limitations to users on hard drive space usage. Two types of quotas exist:
Hard : Permissions are limited to hard capacity
Sof: limited with an amount designed as a limit , when the limits exceed, there is a timer that
gives ane time extension until we return bach down the limit.
quota: package that should be intalled using the package manager.
- on the /etc/fstab , we should add usrquotq,grpquota as options.
- we should remount the partition : mount -o remount /dev/sdb2
quotaof: to make sure that the quota are off on the partition
quotacheck : to check and create quotas
-cug /dev/sdb2
edquota: to edit and set quotas for groups and users
-u user /dev/sdb2
repquota: reports existing quotas on a device.
Scripting Basics:
#: used to make a line as a comment that it's not interpreted on the execution exept the first
line.
shebang : the first line that begin with "#!" tha specifies the interpreter for the script. this is
followed by the path to the interpreter (#!/bin/bash
echo: it prints on cmnd line the specified String.
echo " What to print".
Variable: a way to store information during the script execution.
VAR="Value"
$VAR: it returns the value of the variable VAR.
Substitution : replace the value of a variable by the result of a command
MYFILES=$(ls -l)
command: you can just specifie the command to excute on the script and then it returns the
command result during the excutions.
NB: you should change the permissions of the file to be executed. If it cannot be changed, you
can use : bash script1
let: this command is used to change the value of a variable (let VAR=VAR+1)
Display Managers:
Diplay Manager: GUI inteface you can login when you are running graphical interface on the
computer.(exemple lighdm, XDM, KDM, GDM)
/etc/lightdm: configuration files for the lightDM.
Accessibility:
Nothing Special to mention.