Linux Flashcards
Configure IP address command on linux
sudo ip addr add 192.168.1.10/24 dev eth0
Network configuration file path on Debian and Ubuntu
/etc/network/interfaces
Network configuration file path on RHEL/CentOS
/etc/sysconfig/network-scripts/ifcfg-eth0
Configure IP route on Linux
sudo ip route add 192.168.2.0/24 via 192.168.1.1 dev eth0
DNS servers configuration file path on linux
/etc/resolv.conf
Display first 20 lines of a file on Linux
head -n 20
Display first 20 characters of a file on Linux
head -c 20
Substitution command. Substitute ( and ) by [ and ]
Hey (my name) is (josh)
tr “(“ “[” | tr “)” “]”
Hey, [my name] is [josh]
chmod 777
OGU
owner-group-user
7 = owner
7 = group
7 = user
chmod permission values
r = ?
w = ?
x = ?
r = 4
w = 2
x = 1
chmod with letters
+: adds permission
chmod o+rwx
chmod g+rwx
chmod u+rwx
-: removes permission
chmod o-x
chmod g-w
chmod u-w
=: sets permission overriding existing ones: (on below example read and write permissions won’t be granted, just execute permission)
chmod o=x
chmod g=x
chmod u=x
basic components of Linux
- kernel
- system libraries
- system utilities
- programming tools
Linux file system hierarchy
- /etc contains configuration files
- /dev contains device files
- /home contains user home directories
- /usr contains user utilities and applications
- /var contains variable data files
Check Linux Memory Utilization
free -h
What are Shells Used in Linux?
Shells in Linux are command-line interpreters that provide a user interface for access to an operating system’s services. They allow users to execute commands, run scripts, and manage files and processes.