You are on page 1of 4

The Data Structure of the RH7

What is the Diff b/w RH7 and RH6


===========================
In This Lecture #2
====================
-Access a shell prompt and issue commands with correct
Syntax
-Use input- output redirection (>,>>, |, 2>, etc)
-Use grep and regular expressions to analyze text.
-Log and switch user in multiuser targets
-Archive , compress, unpack , and uncompressed files
using tar,gzip and bzip2
-create , edit text files
-create , delete, copy and move files and directories
-create hard and soft links
==========================================
How many types of Commands?
1)alias
2)internel command
3)External command

--> For Internal command backend process is not required.


cd,ls ,pwd
-->For External Command backend process is required.
when we execute extenal command in the backend the process is create
for the command./in runing stat.
alias (replace the command with shortcut\]
How to check the all alias of the system?
================================
#alias command is used, to show the alias record.

How to create alias ?


=================
# alias 'alias name'='command'
for example we want to crate alias for the date

# alias d='date'

this alias is create for run time . when the system is reboot the alias is
distroyed .

we want to save these alias permonantly.


the following step for to save the alias permonantly.
# vim /root/.bashrc
User specific alias and functions
save in this file

alias rm='em -i'


alias cp='cp -i'
alias mv='mv -i'
alias c='clear'
save the all alias in this file
:wq

#source /root/.bashrc

What is input-output Redirection?


===========================
Outpur redirection
===============
> the sign is used for
overwrite the file.
blanck the file.
replace the file.
>> append
2> stderror
&> stdoutput & error
2> /dev/null (bit-bucket)
to delete the unwanted output data without the tree.
it is also known as black-hole.

#echo "hi welcome to urduit" > shdout


#ls
#cat stdout
#
#echo "please subscribe to urduit youtube channel" >> stdout
# cat stdout

Remove the first stdout file:


---------------------------------
# rm -rf stdout
Now we want to empty the stdout file.
remove the text from stdout .
# > stdout
=====================
Standared Error 2>
#ls -xz
#ls -xz 2> stderror
#cat stderr

#ls -yxz 2>> stderr


#cat stderr
&> = stdoutput and error
====================
# ls /bin/test
#ls /bin/abc
#ls /bin/abc &>stdouterr

#ls / &>> stdouterr

#ls -yah 2> /dev/null


">" ">>" "2>" "&>" "2> /dev/null"

InputRedirection
================
#touch stdin.txt
#cat < stdin.txt
-Log and switch user in multiuser targets
How to change the mode of system?
=============================
#systemctl get-default

Now we want to change the mod to multi-user mod

#systemctl set-default multi-user.target


#reboot -f
Now again we change the multi-user mode to grapical-mode

#systemctl set-default grapical.target

#systemctl isolate grapical.target

===========================================
-Archive , compress, unpack , and uncompressed files:
===========================================
1)Archive
=======
Diff tool is used for Archive.
How to create archive of a folder.
---------------------------------------
# cd /
#tar -cvf boot.tar boot
Here boo.tar is distination folder.
boot is the source folder.

#ls
now how to check the size of archive folder.
#du -hs boot.tar

Compress the folder:


=================
Now how to compress the boot.tar folder
--------------------------------------------------
#du -hs boot.tar
the commd show you the size of achive file.
#gzip boot.tar boot.tar.gz

Uncompress the folder:


==================
#gunzip boot.tar.gz

Remove the boot.tar folder


---------------------------------
#rm -rf boot.tar

Now create the Archive the boot folder another way:


--------------------------------------------------------------
#tar -zcvf boot.tar.gz boot

bzip2:
=====
create archive of a folder with the help of bzip2 tool.

#bzip2 boot.tar boot.tar.bz2

to unzip the bzip2 folder.


#bunzip boot.tar boot.tar.bz2

another command is used for to take archive of a folder through bzip2 tool
#tar -jcvf boot.tar.bz2 boot
ne

You might also like