Saturday 25 February 2023

RHCSA Exam Notes : Hard and Soft link in Unix/Linux

 Create Hard links:

Command:

The below command created hardlink called file1.txt for the existing file trial1.txt in /home/student

ln file1.txt /home/student/trial1.txt

Create Soft link:

Command:

The below command created soft link called file1.txt for the existing file trial1.txt in /home/student

ln -s file1.txt /home/student/trial1.txt


Monday 20 February 2023

Red Hat Certified System Administrator(RHCSA) Exam - Key points(Notes)

 list command in unix : ls

ls

It will show the full list or content of your directory

 

ls -a

In Linux/Unix, hidden files start with . (dot) symbol and they are not visible in the regular directory. The (ls -a) command will enlist the whole list of the current directory including the hidden files.

 

 ls -l

It will show the list in a long list format. 

 

Column 1 : indicates information regarding file permission.
Column 2 : indicates the number of links to the file.
Column 3 & 4 : indicates the owner and group information.
Column 5 : indicates the file size in bytes.
Column 6 : shows the date and time on which the file was recently modified.
Column 7 : shows the file or directory name.

 

ls ~

ls ~ command shows the contents of the home directory

 

 

ls -g

If we don't want to display the owner information in your list, then we can exclude this column with the help of this command. 

 

 

ls -lrt

The ls command is used for listing the contents of a directory. The lrt part is a combination of three different options:

  • l: This is for the long listing of the contents. It shows one file in each line with additional info such as permissions, ownership, size, timestamps etc.
  • t: This one sorts the long listing output based on time.
  • r: This one reverses the order of ls command output.

 

 

 

ls -n

It is used to print group ID and owner ID instead of their names.

 

 

 ls -li

This command prints the index number if file is in the first column.

 

 

 ls -p

It is used to identify the directory easily by marking the directories with a slash (/) line sign.

 

 

ls --version

It checks the version of ls command.