1/183
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
linux has super user account called
root
linux is
case sensitive, file ABC is not the same as file abc
when creating files avoid using
spaces
linux kernel is
Not an operating system, it is a small software that takes commands from users and passes them to system hardware
2 types of access
console
remote
command to remotely access linux machine
ssh 192.168.1.1
command to remote into linux machine with username
ssh -l <username> <ip-address>
get ip address
ip addr
command prompt order
username - hostname - prompt symbol
get prompt back
ctrl + c
get username
whoami
get hostname
hostname
there are 3 types of root on a linux system
root account → has access to all commands
/ → root directory
/root → root home directory
change password
passwd userid
linux file systems
ext3, ext4, xfs
go to a different directory
cd
directory where log files are located
/var
directory where commands are located
/sbin
directory that contains files used by bootloader
/boot
directory that contains root user home directory
/root
directory that contains configuration files
/etc
directory that contains system devices
/dev
directory that contains everyday user commands
/usr/bin
directory that contains system file commands
/usr/sbin
directory that contains optional add ons
/opt
directory that contains running processes used only in memory
/proc
directory that contains programming library files
/usr/lib
directory that contains temporary files
/tmp
directory that contains system logs
/var
switch directories
cd
find which directory you are currrently in
pwd
list the contents of a file
ls <filename>
c: drive (windows) is the same as what in linux
/
become root
su -
wipe the screen
clear
when doing ls… anything that starts with - is a
file
when doing ls… anything that starts with d is a
directory
go one directory back
cd ..
when doing ls… anything that starts with l is a
link
an absolute path always begins with
/
command to create a file
touch <filename>
copy an existing file
cp <filename> <new-file>
create a directory
mkdir
check that file/dir was created
ls -l
list files by when it was last modified
ls -ltr
ls -ltr sorts by
oldest at top, newest at bottom
create vi file
vi <filename>
:wq!
create multiple files
touch file1 file2 file3
copy a directory
cp -R <source> <destination>
two main commands used to search for files
find
locate
use the find command to search for a file
find . -name “<name">”
if locate command doesn’t work
updatedb
use locate command to search for files
locate <filename>
difference between find . and find /
. means current directory
/ means start the search from root
use find command to search from current directory
find . -name “<filename>”
use find command to search from root
find / -name “<name>”
which is faster locate or find
locate
to run updatedb you need to be
root or use sudo
*
represents anything
?
represents a single character
[ ]
represents a range of character
use a wildcard to remove EVERY file that starts with abc
rm abc*
remove a directory
rm -r <dir.name>
create 9 files using a wildcard
touch abcd{1..9}
remove everything that ends with xyz
rm *xyz
file symbol -
regular file
file symbol d
directory
file symbol l
link
file symbol c
special file or device file
file symbol s
socket
file symbol p
named pipe
file symbol b
blocked device
in windows a directory is called a
folder
2 types of links
soft links and hard links
if you attach a keyboard to your system the linux OS
creates a c file
socket files are used for
network communication between processes
named pipe files
FIFO (first in, first out)
inode
pointer or number on a file
soft link
link that when created will be removed if file is removed or renamed
how do links work
they point towards inode
hard link
deleting or renaming source file will not remove link
create a hardlink
ln <source> <destination>
create a soft link
ln -s <source> <dest>
write to a file
echo “<text”>
read what you wrote to the file
cat <filename>
find inode of file
ls -li <file>
linux has a super user called
root
linux is
case-sensitive
avoid using
spaces
is linux kernel an OS
FUCK NO
2 types of access
console
remote
remote access linux to linux
ssh 192.168.1.1
get your prompt back
ctrl + c
how to open terminal
right click desktop
Get the username
whoami
find the name of your machine
hostname
go to root directory
cd /
root home directory
/root
change a password
passwd userid