Basics for RHCSA (2)

Basic Commands

 hostname command is used to retrieve host name of the system.
cd command is used to change directory. you should replace <file path> with suitable path. For an example cd /etc. It change the directory to /etc directory.
 cd / command is used to change directory to root directory.
 cp command is used to copy files one place to another place. So you will replace <name> with your file name and <destination > should be replaced with proper existing destination.

 date command is used to retrieve current date and time
This date -d command is for checking future date
 exit command is used to go backward.
 ifconfig is used to retrieve information about network interface
 ls is for listing the content of particular directory.
 man command is the most useful command in linux/redhat. because it will say all about the command. so you should replace <command> with relevant command that you want to know. Actually man command retrieve manual page of given command. For an example man ls

mkdir is used to create directories. <file name>  should be replaced by particular name. So after executing that command file will be created with given name.
mkdir -p is a very helpfull command. For an example if you want to create a file structure like /management/branches/employees , if you use mkdir command you should follow following steps.
mkdir /management then cd /management again mkdir /branches then cd /branches ....... like that.
But mkdir -p is create parent directory first. so it make our life more easier.
pwd is used to print working directory. Simply "now where am I ?"
 rm is used to remove files. <filename> should be replaced by the file name that you want too remove.
 su command is used for switching between users. <username> should be replaced.
su - switch to root user
touch is used to create an empty text file.

whoami is used to print user id.

How to create your own command using bashrc

Think you are asked to create a short command to make /Management/Branches/Employees/New directories. when you press ch it should be created.

So after that bashrc will open.


























  1. Then press shift+G to go bottom of the file. 
  2. Then press i to switch the mode to insert. 
  3. Then type alias ch='mkdir -p /Management/Branches/Employees/New ' 
  4. Press ESC
  5. type :WQ to save and quit                         
 Then you will redirect to the terminal.
After that type following command to enable it


 if there is no error you can use your command now.

So these are the basics that you have to know before enter to the rhcsa course.

Comments

Popular posts from this blog

Add Cisco Layer 2 Switch in GNS3 - GNS3 වලට Cisco Layer2 Switch එකක් ADD කිරීම

Schedule Tasking using "crontab" and "at"

User Management (1) - RHCSA