Basic Commands Of Red Hat

Basic command in Red Hat :

[root@localhost ~]#date O/P : Mon Nov 21 17:35:15 IST 2011

pwd & cd command :

pwd :Present working directory or To show where are you working.

cd : Change directory{directory=folder}

  • [root@localhost~]#pwd O/P : /root
  • [root@localhost ~]#cd /etc
  • [root@localhost etc]# pwd O/P : /etc
  • [root@localhost etc]# cd ./sysconfig/
  • [root@localhost sysconfig]#pwd O/P : /etc/sysconfig
  • cd.. :- To go back one step.
  • cd../.. :- To go back two step.
  • cd../../.. :- To go back three step.
  • cd :- To go the home directory.
Notepad

Eg : [root@localhost ~]#cd /etc/sysconfig/networ-script
[root@network-script ]# cd ../..
[root@localhost etc]#

Clear :

  • clear : To clean the screen
  • history : To show the used command list
  • history -c : To flush the history {to remove history}
  • eject : To open the cdrom
  • eject -t: To close the cdrom
  • init 0 : To shutdown the computer
  • init 6 & reboot : To restart the computer
  • logout : To logout from cli-command promt

How to create a file in Red Hat :

cat, touch command is use for create a file

Eg : How to create a Empty file on desktop ?
Answer : touch /root/Desktop/abc

Eg : How to create multipal file on desktop ?
Answer : touch /root/Desktop/{a,b,c}

Eg : How to a file on desktop & put data in it ?
Answer : cat > /root/Desktop/xyz
This is BookOfNetwork.
Ctrl+D----To save the file

Eg : How to show the data ?
Answer : cat /root/Desktop/xyz
This is BookOfNetwork.

Eg : How to replace the data ?
Answer : cat > /root/Desktop/xyz
We are learning Red Hat.
ctrl+D-------save & exit

Notepad

Note : Old data will replace by new data.

Eg : How to append(add) the file ?
Answer : cat >> /root/Desktop/xyz
I am online tutorial learning web site.
trl+D---------save & exit

Notepad

Note : Old data is remain & new data is add.

Eg : How to copy data ?
Answer : cat /root/Desktop/xyz > /root/Desktop/abc

#Basic_command_in_Red_Hat #pwd_&_cd_command #Clear_command_in_red_hat #How_to_create_a_file_in_red_hat

(New page will open, for Comment)

Not yet commented...