Redhat Adminexported
Redhat Adminexported
1983 - Richard Stallman Retired from Bell Labs and Started his own Project GNU (Open Source)
Linux History 1991 - Linus Torvalds Made some enhancements to unix kernel
1995 - Windows Came with GUI Xorg made Xprotocol (Linux GUI)
Redhat = Linus Kernel + Richard's GNU +Xprotocol + Apps Made RHEL and Fedora
Debian Made the Same thing and Came up with Debian and Ubuntu
CentOS
Root User ID = 0
/home Contains a Directory for each User Ex: /home/mohamed/ Desktop, Downloads........
/bin Contains the binary files of the Commands Ex: the binary files of the ls, cd, mv commands
/sbin Contains the binary files of the System Commands Ex: the binary files of the useradd, userdel Commands
ls -R Recursive
mv Move or Rename files Ex: mv file1 /home/ahmed/Desktop Ex: mv file1 file2
su Switch User used to change the current logged in user Ex: su - root
unning Commands and
R
Command <Options> <Arguments> passwd change user password Ex: Passwd khaled
Getting Help
useradd add a new user Ex: useradd Mohamed
head display the first 10 lines of a text file Ex: head file1.txt
tail display the last 10 lines of a text file Ex: tail file1.txt
wc Word Count Display the Number of lines, words and characters of a file Ex: wc file1
cat
more
whatis
-G overwrite
usermod Ex: usermod -G sales mohamed
-a append
hostname Server1 Changes the host name to server1 the result will be root@server1 will be reset after reboot
Sudoers File gives user administrator privileges (use sudo command) Ex: nano /etc/sudoers
Ex: visudo
I/O Redirection , Piping , Tee tr 'a-z' 'A-Z' < /etc/passwd Input Redirection
every file has an owner, group and other each one has his own permission
Owner " u " , Group " g " , Other " o " , All " a "
r wx = 4+2+1 = 7
x: if we want a file permission to be rwx rw- r--
E
Numeric Read = 4 , Write = 2 , Execute = 1 rw = 4+2+0 = 6
we will use the following comand: chmod 764 file2
r = 4+0+0 = 4
chgrp used to change the group of a file Ex: chgrp sales file1
Insert Mode Press " ESC " to get back to Command mode
Vim Exit in Command mode use " :w " to write " :wq " to write and quit " :q! " to exit without saving
'A' used to append Jump to the end of a line and enter insert mode
yum install nano Checks the Repository and start installing nano Repositories Could be Found at /etc/yum.repos.d
Managed by firewall-cmd
firewall-cmd --add-service=http we can add --permanent so we don’t lose the configuration after reloading firewall
grep used to extract rows matching a criteria grep -A2 "khaled" /etc/passwd
t he fastest way to search for a file in linux but it’s using a pre-built database of
locate paths to files on the system Ex: locate file1
DataBase must be updated by admin using "updatedb" Command
c = Create an archive
t = list an archive
x = extract files from an archive
tar is an archiving tool in linux tar cvf ArchiveName Files... v = verbose
f = file name
z = use gzip compression
Archiving j = use bzip2 compression
an be Found at
C
Global /etc/bashrc
/etc/profile
Startup Files
/.bashrc
~
User-Specific
~/.bash_profile