Git Product home page Git Product logo

iti_redhat's Introduction

RedHat

LAP 1

2-cat: scroll off and display the end of pages more: display output one screen at one time (page by page) 3-rm: to remove files rmdir: to remove directory 4-/home --> mkdir dir1 doc /home/dir1 --> mkdir dir11 dir12

photo_5987695585202912862_x

/home/doc --> touch mycv /home/dir1/dir11/ --> touch file1

photo_5987695585202912863_x

4-a-rmdir dir11

photo_5987695585202912865_x

4-b- rmdir -p

photo_5987695585202912866_x

4-c- home ./home

5-cp etc/passwod home/mypasswod

photo_5987695585202912867_x

6-mv mypasswd oldpasswd

photo_5987695585202912868_x

7-../../home or cd /home or cd ~home or cd-home 8-ls /usr/bin/w*

photo_5987695585202912871_x

9-head -n 4 /etc/passwd

photo_5987695585202912872_x

10-tail -n 7 /etc/passwd

photo_5987695585202912873_x

11- man passwd && cat /etc/passwd

photo_5987695585202912874_x

12-man 5 passwd

photo_5987695585202912875_x

13-man -K passwd

photo_5987695585202912877_x


Lab2

1-sudo useradd -c "islam asker" -m islam sudo passwd islam photo_5987695585202912751_x

2-sudo useradd -c "Bad User" -m baduser sudo passwd baduser

photo_5987695585202912751_x

3-sudo groupadd -g 30000 pgroup

photo_5987695585202912753_x

4-sudo groupadd -g 20000 badgroup

photo_5987695585202912754_x

5-sudo usermod -aG pgroup islam

photo_5987695585202912758_x

6-sudo passwd islam

photo_5987695585202912759_x

7-sudo chage -M 30 islam

photo_5987695585202912761_x

8-sudo usermod -L baduser

photo_5987695585202912762_x

9-sudo userdel -r baduser

photo_5987695585202912766_x

10-sudo groupdel baduser

photo_5987695585202912769_x

13-mkdir ~/myteam chmod 400 ~/myteam

photo_5987695585202912771_x

14-su islam

photo_5987695585202912792_x

15-sudo cd ~/myteam

photo_5987695585202912775_x

16-1-sudo touch oldpasswd chmod u=rw,g=wx,o=x oldpasswd chmod 711 oldpasswd

photo_5987695585202912780_x

16-2-16 -2 Default permissions for files: 666 (rw-rw-rw-) Default permissions for directories: 777 (rwxrwxrwx)

16-3-umask 077 mkdir testdir touch test

photo_5987695585202912782_x


Lab3

1- vi mycv

photo_5987955207386021479_m

photo_5987955207386021483_m

2- a. Move the cursor down one line at a time:

Press j

b. Move the cursor up one line at a time:

Press k

c. Search for the word "age":

Type /age and press Enter

d. Step to line 5:

Type :5 and press Enter

e. Delete the line you are on and line 5:

Type dd to delete the current line
Type :5 and press Enter to move to line 5
Type dd to delete line 5

f. Step to the end of the line and change to writing mode in one step:

Press $ to move to the end of the line
Press A to enter insert mode at the end of the line

3-cat /etc/shells

photo_5987955207386021480_x

4-env

photo_5987955207386021484_x

5-printenv

photo_5987955207386021485_x

6- echo $HOME

photo_5987955207386021486_x

7-echo $SHELL

photo_5987955207386021487_m

8-whereis sh whereis ksh whereis bash

photo_5987955207386021488_x

9-nano ~/.bashrc echo "Welcome, $(whoami)! Today is $(date)"

photo_5987955207386021491_x

photo_5987955207386021500_x

10-
enter echo \ and press Enter. The shell sees the backslash as an escape character, so it expects that the command is not complete and waits for more input. The shell shows a continuation prompt, which is often >, indicating that it's waiting for additional input to complete the command.

So, the continuation prompt (>) is telling you that the command you entered is not yet complete, and the shell is waiting for more input.

To change the continuation prompt from > to :, you can use the PS2 variable. This variable controls the secondary prompt (the continuation prompt). You can set it in your shell configuration file, such as ~/.bashrc.

11-alias ls="ls -l"

photo_5987955207386021492_x


Lab 5

1-compress file gzip -v file1 zip -v file2

photo_5987695585202912951_x

file extention: The compress command uses the .Z file extension for compressed files. The gzip command uses the .gz file extension for compressed files. The zip command creates a zip archive with the specified file(s) and uses the .zip extension.

-gzip is more widely supported and used on various platforms. compress is less common today and may not be available by default on some systems. -gzip has additional features, such as the ability to compress multiple files into a single archive (tar can be used in conjunction with gzip for this purpose).

2-zcat example.txt.gz

photo_5987695585202912953_x

3-tar -cvf ~/etc *

photo_5987695585202912954_x

4-find ~/ -type f -mtime -2

photo_5987695585202912955_x

5-sudo find /etc -type f -user root

photo_5987695585202912958_x

6-find ~/ -type d

photo_5987695585202912960_x

7- sudo find / -type f -name ".profile"

photo_5987695585202912961_x

8- file /etc/passwd file /dev/pts/0 file /etc file /dev/sda

photo_5987955207386021496_x

9- ls -i / ls -i /etc ls -i /etc/hosts

photo_5987695585202912962_x

photo_5987695585202912963_x

10-cp /etc/passwd ~/passwd_backup diff /etc/passwd ~/passwd_backup cmp /etc/passwd ~/passwd_backup

vi ~/passwd_backup diff /etc/passwd ~/passwd_backup cmp /etc/passwd ~/passwd_backup

photo_5987955207386021503_x

11-sudo ln -s /etc/passwd /boot/passwd_link ls -l /boot

photo_5987955207386021509_x

12- sudo ln /etc/passwd /boot/passwd_link the /boot directory is on a different partition, you'll likely encounter an error message indicating that hard links across file systems are not allowed.

photo_5987955207386021511_y

ShellScript

Lap1

#sed

1-sed 'lp/p' /etc/passwd

photo_5994743665190354553_y

2-sed -e '3d' -e '1,$p' /etc/passwd

photo_5994743665190354543_x

3-sed -e '$d' -e '1,$p' /etc/passwd

photo_5994743665190354544_y

4-sed -e '/lp/d' -e '1,$p' /etc/passwd

photo_5994743665190354564_y

5-sed 's/lp/mylp' /etc/passwd

photo_5994743665190354549_x

#awk

1-awk -F: '{print $5}' /etc/passwd

photo_5994743665190354572_x

2-awk -F: '{print $1,$5,$6}' /etc/passwd

photo_5994743665190354575_x

3-awk -F: '{ if($3>500) print $1,$3,$5}' /etc/passwd

photo_5994743665190354578_x

4-awk -F: '{ if($3==500) print $1,$3,$5}' /etc/passwd

photo_5994743665190354579_x

5-awk -F: '{ if(NR>=5&&NR<=15) print NR,$0}' /etc/passwd

photo_5994743665190354598_x

6-awk -F: '{for(i=1;i<=NF;i++) {if($i=="lp") $i="mylp"} print ;}' file1

photo_5994743665190354604_y

7-awk -F: 'BEGIN {max=0} {if ($3>max) {max=$3; maxline=$0}} END{print maxline}' file1

photo_5994743665190354620_y

8-awk -F: 'BEGIN {sum=0} {sum+=$3} END {print sum}' file1

photo_5994743665190354626_x


Lab3

Q1

photo_5996948924738419950_w

Q2

photo_6017092385781169631_y

photo_6017092385781169634_m

Q3

photo_6017092385781169676_x

photo_6017092385781169677_y

Q4

photo_6017092385781169682_x

photo_6017092385781169683_x

Q5

photo_6017092385781169701_w

photo_6017092385781169702_x

Q6

photo_6017092385781169705_x

photo_6017092385781169706_y

photo_6017092385781169707_x


Lab3

Q1

photo_6017203977621454736_x

photo_6017203977621454737_x

Q2

photo_6017203977621454752_x

photo_6017203977621454753_x

Q3

photo_6017203977621454754_x

photo_6017203977621454755_x

Q4

photo_6019141214030380630_x

photo_6019141214030380631_x

Q5

photo_6019141214030380634_x

photo_6019141214030380633_x

Q6

photo_6019141214030380636_y

photo_6019141214030380635_x

Q7

Screenshot from 2023-12-19 11-16-50

Q8

Screenshot from 2023-12-19 11-21-31

Q9

Screenshot from 2023-12-19 11-25-35

Q10

Screenshot from 2023-12-19 11-30-22

Q11

Screenshot from 2023-12-19 11-35-22


Admin2

Lab6

Q1:Use systemctl to view the status of all the system services.

Screenshot from 2023-12-19 12-29-56

Q2:Change the default run level back to multi-user.target and reboot.

sudo systemctl set-default multi-user.target

reboot .target

Screenshot from 2023-12-19 14-42-34

Q3:Send mail to the root user.

Screenshot from 2023-12-19 14-55-11

Q4:Verify that you have received this mail.

Screenshot from 2023-12-19 14-58-56

Q5:Use systemctl utility to stop postfix service

Screenshot from 2023-12-19 15-01-54

Q6:Send mail again to the root user.

Screenshot from 2023-12-19 15-07-04

Q7:Verify that you have received this mail.

Screenshot from 2023-12-19 15-09-01

Q8:Use systemctl utility to start postfix service

Screenshot from 2023-12-19 15-12-06

Q9:Verify that you have received this mail

Screenshot from 2023-12-20 08-47-54

Q10:Edit in the GRUB2 configuration file and change the timeout variable equal 20 seconds.

Screenshot from 2023-12-20 09-05-01

Screenshot from 2023-12-20 09-05-22

Q11: Edit in the GRUB2 configuration file and change your default operating system

Screenshot from 2023-12-20 09-10-29

Q12:You want to know some information about the status of the system every ten minutes today between the hours of 8:00 AM and 5:00 PM. to help investigate some performance issues you have been having. You suspect it might be memory related and want to keep an eye on those resources.

Screenshot from 2023-12-24 00-23-20

Q13:Use mail as the root user to check for e-mail from the cron jobs you have scheduled.

Screenshot from 2023-12-24 00-29-32

Q14:How could you send the output from these cron jobs to another e-mail address (the manager user)?

Screenshot from 2023-12-24 00-33-13

Q15:Use mail as the manager user to check for e-mail from the cron jobs you have scheduled.

Screenshot from 2023-12-24 00-35-33

Q17:Attempt to run the command gnuplot. You should find that it is not installed.

Screenshot from 2023-12-20 09-35-27

Q18:Search for the plotting packages.

Screenshot from 2023-12-20 09-37-44

Q19:Find out more information about the gunuplot package.

Screenshot from 2023-12-20 09-41-55

Q20:Install the gnuplot package.

Screenshot from 2023-12-24 00-42-42

Q21:Attempt to remove the gnuplot package, but say no How many packages would be removed

Screenshot from 2023-12-24 00-44-58

Q22:List all installed packages in your system.

Screenshot from 2023-12-24 00-47-10

Q23:View the files in the initscripts package

Screenshot from 2023-12-24 00-49-55

Q24:Get general information about bash rpm.

Screenshot from 2023-12-24 00-51-07

Q25:Have the files from the pam package changed since it was installed.

Screenshot from 2023-12-24 00-52-58

Q26:Which installed packages have gnome in their names?

Screenshot from 2023-12-24 00-54-53


Lab 7

Q1:Using the useradd command, add accounts for the following users in your system: user1, user2, user3, user4, user5, user6 and user7. Remember to give each user a password.

Screenshot from 2023-12-24 01-02-09

Q2:Using the groupadd command, add the following groups to your system. Group GID sales 10000 hr 10001 web 10002 Why should you set GID in this manner instead of allowing the system to set the GID by default?

Screenshot from 2023-12-24 01-06-04

Q3:Using the usermod command to add user1 and user2 to the sales secondary group, user3 and user4 to the hr secondary group. User5 and user6 to web secondary group. And add user7 to all secondary groups

Screenshot from 2023-12-24 01-10-44

Q4:Login as each user and use id command to verify that they are in the appropriate groups. How else might you verify this information?

Screenshot from 2023-12-24 01-15-56

Q5:Create a directory called /depts with a sales, hr, and web directory within the /depts directory.

Screenshot from 2023-12-24 01-18-34

Q6:Using the chgrp command, set the group ownership of each directory to the group with the matching name

Screenshot from 2023-12-24 01-20-38

Q7:Set the permissions on the /depts directory to 755, and each subdirectory to 770

Screenshot from 2023-12-24 01-22-37

Q8:Set the set-gid bit on each departmental directory

Screenshot from 2023-12-24 01-24-30

Q9:Use the su command to switch to the user2 account and attempt the following commands: touch /depts/sales/user2.txt touch /depts/hr/ user2.txt touch /depts/web/ user2.txt Which of these commands succeeded and which failed? What is the group ownership of the files that were created?

Screenshot from 2023-12-24 01-28-50

Screenshot from 2023-12-24 01-29-38

Q10:Configure sudoers file to allow user3 and user4 to use /bin/mount and /bin/umount commands, while allowing user5 only to use fdisk command.

Screenshot from 2023-12-24 01-32-18

Q11:Login by user3 and try to unmount /boot.

Screenshot from 2023-12-24 01-34-16

Q12:Login by user4 and remount /boot. Also try to view the partition table using fdisk.

Screenshot from 2023-12-24 01-34-42

Screenshot from 2023-12-24 01-37-37

Q13:Create a directory with permissions rwxrwx---, grant a second group (sales) r-x permissions

Screenshot from 2023-12-24 01-42-20

Q14:create a file on that directory and grant read and write to a second group (sales)

Screenshot from 2023-12-24 01-46-43

Q15:set the the owning group as the owning group of any newly created file in that directory.

Screenshot from 2023-12-24 01-48-20

iti_redhat's People

Contributors

fatmaelhot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.