One of the most famous certificate in world of Linux is RHCSA  Redhat Certified  System Administrator  . There is many tutorials and books online to use  them. and  from my side am trying to contribute this small tutorial maybe can more focus on the bellow contents.

  • Access a shell prompt and issue commands with correct syntax
  • Use input-output redirection (>, >>, |, 2>, etc.)
  • Use grep and regular expressions to analyze text
  • Access remote systems using ssh
  • Log in and switch users in multiuser targets
  • Archive, compress, unpack, and uncompress files using tar, star, gzip, and bzip2
  • Create and edit text files
  • Create, delete, copy, and move files and directories
  • Create hard and soft links
  • List, set, and change standard ugo/rwx permissions
  • Locate, read, and use system documentation including man, info, and files in /usr/share/doc

For a good a practical environment you need a live system like   Redhat ISO  evaluation version or use Centos Linux  (Cloned Free   Redhat)

To get   RHCSA  certificate , we will  handle the topics 1 by 1

  • Access a shell prompt and issue commands with correct syntax

You have to get the access to the machine, preferably with root , and you have to be able to use the  manage your system  from commands

screenshot_20161110_213529

  • Use input-output redirection (>, >>, |, 2>, etc.)

am using as source  (Learn redhat  blogspot)

> – Redirect output. Example:
cat file1 file2 > file3
contents of file1 and file2 will replace the contents of file3 if file3 already exists.

>> – Redirect output appending existing data. Example:
cat file1 file2 >> file3
contents of file1 and file2 will be appended to the contents of file3.
2> – Redirect standard error. Example:
cat file1 file2 > file3 2> file4
contents of file1 and file2 are sent to file3 and any error messages are sent to file4.
&> – This is the same as 2>.
< – Direct alternative input. Example:
mail person < info_file
contents of info_file is used as input for the mail command so that person is mailed the contents of info_file.
| – Pipes output from a command/program to the input of another command/program. Example:
cat file1 file2 | grep argument | wc -l
contents of file1 and file2 are piped to the ‘grep’ command which finds all lines containing ‘argument’ and those lines are piped to the wc -l command which counts how many lines were found. Another example is:
ls -a | sort -i
the output of ls -a is piped to the sort -i command which displays that output sorted ignoring any dots at the start of hidden files. Another example:
cat file1 file2 | grep argument | sort -i

xargs – Run a command multiple times using a list of arguments. Usage syntax:
xargs [options] command [initial arguments]
Example:
find /root -type f -print | xargs grep -n “text string”
the find command looks in /root for regular files using the ‘-type f’ option and prints each file name using the ‘-print’ option but the output is piped to xargs and that passes each file name to grep one at a time, grep then searches each file for “text string”.

tee – Redirect output to a file while also allowing that output to continue to the display (standard output). Example:
ls -a | sort -i | tee filelist
the ls -a command makes a list of all the files and directories within the present working directory and that is piped to the sort -i command. The sorted list in then piped to the tee command which saves the list to a file named filelist and also displays the list on screen.

  • Use grep and regular expressions to analyze text

Grep is a powerful utility that can be used to parse out and or query files for data. Lets say you wanted to find all of the lines that contained the word Jointux in the file test.txt. You could easily do this by typing the following.

Grep by default handles searches case sensitively. To disable it you could add the -i flag as such.

The above would return all the lines that contain the word Jointux or jointux.

You could also search using various metacharacters which would allow you to be more specific with your searches. For instance:

The above command would output every line that started with the word Jointux because we prefixed the search with the ^ character.. You could also throw in the -i flag to run the search case insensitive.

Lets say you wanted to search for lines that ended with the word Jointux. You could use the $ character as such.

The above command returns all lines that ended with the word Jointux case insensitive.
We can also search based on partial match. For instance, lets say we wanted to find every line that starts with L and ends with x. We could do so by the following.

The above command would find every line that starts with J and ends with x. The .* lets grep know that you are trying to search for 0 or more characters in between the J and x. So if 1 of our lines just had the word Jointux. This line would be displayed in the output.
You could also use character classes for your searches to find any line that contains a list of characters. For instance, lets try and find any line that contains the letters J,o,i and the numbers 1, and 2.

The brackets allows you to define a list of characters to search for. You could also search for any lines that have 1 set of letters or another but not both by putting the | symbol in the middle.

  • Access remote systems using ssh

You need  Basic ssh access  (  port  standard 22)

Required SSH Packages:

Required SSH Packages:
openssh
openssh-server

Spread the love

LEAVE A REPLY

Please enter your comment!
Please enter your name here