0% found this document useful (0 votes)
20 views7 pages

Linux History and Access Command Line

The document provides an overview of Linux system administration, focusing on Red Hat and CentOS, including their histories, installation types, and command line usage. It covers essential commands for file management, user interactivity, and system navigation, as well as the structure of the Linux file system. Additionally, it discusses the importance of manual pages and community resources for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views7 pages

Linux History and Access Command Line

The document provides an overview of Linux system administration, focusing on Red Hat and CentOS, including their histories, installation types, and command line usage. It covers essential commands for file management, user interactivity, and system navigation, as well as the structure of the Linux file system. Additionally, it discusses the importance of manual pages and community resources for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Linux System Administration:

Red hat System Admin I:


1. Linux History and Access the Command Line

Centos Download Link:

http://centos.hqserv.co.il/7.8.2003/isos/x86_64/CentOS-7-x86_64-Everything-
2003.iso

Linux History:
MULTICS Project created by three companies (Bell Labs now AT & T, General
Electric (GE), MIT University) in 1969. To provide the three main functions User
friendly, Multiuser and data sharing.

This partnership ended and Bell labs decided to continue development in this
project and called it UNICS and then its name changed to UNIX it was written in
C Language in 1970.

AT&T licensed UNIX to outside parties in the late 1970s, leading to a variety of
both academic and commercial UNIX variants from vendors.

University of California ==> Berkeley S/W Distribution (BSD) and freeBSD


IBM ==> AIX
HP ==> HPUX
SUN ==> Solaris
Oracle ==> Oracle Solaris

Richard Stallman is the god father of open source S/W. He makes a project called
GNU project, its objective to make the source code of the open source S/W free for
development and publish the S/W owner.
General Public license (GPL) for open source code.

In 1991 Linus Torvalds developed a new kernel based on the UNIX kernel,
RedHat founded 1994. RedHat is Commercial (Updates, Application Support and
OS Support) stable release every 5 years.
Redhat Packages: ftp://ftp.redhat.com
Centos (Community Enterprise Operating System) is a Linux distribution that
provides a free, enterprise-class, community-supported computing platform
functionally compatible with its upstream source, Red Hat Enterprise Linux
(RHEL).

Fedora is Red Hat Project (buggy release) used for developer testing and home
users. The Fedora operating system is released every 6 month.

Debian ==> Commercial Stable


Ubuntu ==> Buggy release
SUSE ==> Commercial Stable

User interactivity:
-GUI
-CLI (CMD or Shell)
-Remote Login (ssh protocol)
-Web Based Dashboard

Installation types:
-Graphical Installation
-Kickstart Installation

OS Component:
-kernel: it is the core of the operating system
-shell and libraries: shell is used to run certain libraries to compile any application
-Terminal: the window that is used to run the shell

Take care of writing the command:


-spelling
-Case sensitive
-spaces
-syntax

command -option argument


option: used to change the behavior of the command
argument: it is the target file or directory
Example:
[root@server ~]$ps ==> to see the current process that the user running
[root@server ~]$ls -l ==> show detailed information of my current files and
directories
[root@server ~]$more /etc/passwd ==> reads the output of More command
[root@server ~]$wc -l /etc/passwd ==> count the lines of the /etc/passwd file

Linux Tree:
It is inverted tree where its root is the / it is like the C partition in windows, under
this tree directories or Partitions in the following form:

/etc ==> it holds the configuration files of the system (passwd, shadows and group)
/var ==> Variable data of the system, these files are dynamically changed
(database files, mail directory, log files, printer and website content)
/usr/bin ==> user commands (binaries) ==> ls command
/usr/sbin ==> system administration ==> command blkid
/usr/local ==> used by system administrators, when installing software locally. It
needs to be safe from being overwritten when the system software is updated.
/home/ ==> standard user home (ali, ahmed, sami)
ex. /home/ali, /home/sami, /home/ahmed.
/root ==> super user home
/tmp ==> temp files that is deleted after 10 days, /var/tmp deleted every 30 days
/dev ==> system devices (hard disks)
/boot ==> to boot the operating system (grub)
/sys ==> hardware of the system
/run ==> runtime data for processes started since last boot. Include process id and
lock files. The content of this directory are recreated on reboot (journald)
/proc ==> it is the image or the view of the kernel, it is read only and cannot be
deleted.

Soft links (short cuts) in RHEL 7:


/bin ==> /usr/bin
/sbin ==> /usr/sbin
/lib ==> /usr/lib
/lib64 ==> /usr/lib64
Absolute path vs relative path:

Absolute path Must start with / ex. /home/iti/files/f1


Relative path cannot start with / and start with my current directory on the system
ex. ../home/iti/files/f1

Note:
.. ==> means the parent directory
. ==> means the current directory
Ex.
pwd ==> to know the current location on the system
cd ==> is used to change the directory

[user1@server ~]$pwd
[user1@server ~]$cd /home/iti ==> absolute path
[user1@server ~]$cd ../../root ==> relative path
[user1@server ~]$cd ~ ==> to be in home directory
[user1@server ~]$cd ==> go to home directory
To be in my home directory cd or cd ~ command

Machine:
[user1@server ~]$uname
[user1@server ~]$uname -a ==> will display FQDN, kernel, processor arch., etc…
[user1@server ~]$uname -rms ==> will display the kernel version
[user1@server ~]$clear or CTRL +l ==> used to clear the screen.

Date, time and calendar:


[user1@server ~]$date
[user1@server ~]$file /etc/passwd ==> display the type of the file
[user1@server ~]$tty ==> to display the current terminal

To change terminal:
CRTL+ALT+F1-F6 where F1 is the GUI

[user1@server ~]$cat ==> to read file (display all)


[user1@server ~]$cat /etc/passwd ==> display all the file
[user1@server ~]$more ==> read the file and divide it into pages
[user1@server ~]$more /etc/passwd
[user1@server ~]$more -3 /etc/passwd
enter to display line by line
space to move to next page
Q to quit

[user1@server ~]$mkdir ==> to create directory


[user1@server ~]$mkdir dir1
[user1@server ~]$mkdir -p dir2/files
[user1@server ~]$mkdir dir1 dir2 dir3 ==> to create 3 directories in the current
location

Note: there is big difference between /dir2/files and dir2/files. First one will create
the /dir2/files in the root file system ( / ) but dir2/files will create the files in the
location that you are in.

touch ==> to create empty file to write in this file


[user1@server ~]$touch f1

ls ==> to list the content of the files or directories


[user1@server ~]$ls /home/ali
[user1@server ~]$ls f* ==> zero or more characters
[user1@server ~]$ls f? ==> one single char.
[user1@server ~]$ls f?? ==> two single char.
[user1@server ~]$ls /etc/passwd ==> display the name of file only

rm and rmdir:
[user1@server ~]$rmdir dir1 ==> used to remove the empty directory
[user1@server ~]$rmdir -p dir1/files --> used to remove the empty directory and
the subdirectory if it is empty.

rm ==> used to remove files


[user1@server ~]$rm f1
[user1@server ~]$rm -r dir1 ==> to remove the directory and its content
[user1@server ~]$rm -rf dir1 ==> to force remove the directory

Copying files and directories:


cp ==> used to copy files and directories
[user1@server ~]$cp /etc/passwd /home/iti/passwd
[user1@server ~]$cp /etc/passwd /home/iti/users
[user1@server ~]$cp /etc/passwd ./users ==>put users in the current location.
[user1@server ~]$cp /etc/passwd ~
[user1@server ~]$cp -r /usr/lib /home/iti/

Moving and Rename the files:


mv ==> is used to move the file from location to another or to rename file in the
same location
[user1@server ~]$mv passwd users-file ==> rename the file in the same location
[user1@server ~]$mv /home/iti/users-file /home/iti/dir1/files/ ==> move to
another location
[root @server ~]#mv /home/user1/Documents/ /root/Documents ==> to move
Documents from home to root

Head and Tail:


[user1@server ~]$head /etc/passwd ==> to display first 10 lines of passwd file
[user1@server ~]$head -4 /etc/passwd ==> to display first 4 lines of passwd file
[user1@server ~]$tail /etc/passwd ==> to display last 10 lines of passwd file
[user1@server ~]$tail -1 /etc/passwd ==> to display last line of passwd file
tail +3 ==> it will display error

[user1@server ~]$who ==> to display who is currently using the system

Help in Linux and Manual pages:


It is the help of all commands, it is divided into sections nine sections:

[user1@server ~]$man man ==> to see all sections of man pages


[user1@server ~]$man passwd ==> display the executable files that is used to
change the user pass in man page 1
[user1@server ~]$man s5 or 5 passwd ==> to display the format of the passwd file
[user1@server ~]$man -a passwd ==> display all passwd sections in the system
[user1@server ~]$man -k passwd ==> to search with keyword of the passwd

To filter the man pages we use man -k passwd | grep 5


[user1@server ~]$man mkdir
/string
n ==> Search Forward
N ==> Search Backward
G ==> move to the Last Page
g ==> move to the first page
q ==> quit
Used usually with man pages search.
[user1@server ~]$mandb command ==> to update the man database
[user1@server ~]$mandb -c ==> to create the database from scratch
[user1@server ~]$whatis ls ==> display what the command do
[user1@server ~]$whereis ls ==> the command path
[user1@server ~]$which mkdir ==> to get the full path of the command

Documentations are in /usr/share/doc ==> contains the Services templates and


/usr/share/man/ the sections of any man page

Community: https://access.redhat.com/documentation/en-us/

You might also like