Skip to main content

Commands in Red Hat part-1


Basic Linux Commands

To start-up with the Linux first someone needs to know about the basic Linux commands. These commands are common in all Linux distributions. If you know these basic Linux commands, it will be easy for you to get further in in your goal to achieve a RedHat Certification.

To be a system administrator you need to know how to manage the server using command line, because you will hardly allowed to use GUI. Because most of the system administration tasks are managed remotely using the secure shell also known as SSH. So use the command line as much as possible.

Basic Linux Commands and there explanation is given below:


  • uname :- this command returns the name of Operatng System.
  • uname -a :- using :- "a" option with uname command, you will get the following information:
    • Operating System : Linux.
    • Fully Qualified Domain Name.
    • Kernel Version.
    • Date and time that the kernel was compiled.
  • tty :- reveals the current terminal.
  • echo :- prints to the screen.
  • set :- prints and optionally sets shell variables.
  • clear :- clears the screen / terminal.
  • reset :- resets the screen buffer
  • pwd :- prints the path of working directory.
  • whoami :- reveals the current logged-in user.
  • which programe_name :- reveals the path of the program / command.
  • history :- reveals your command history.
  • cd :- changes directory to desired directory:
    • cd with no option will changes to the home directory.
    • cd ~ will also change to the home directory.
    • cd /  will change to the root (/) directory
    • cd ..  will change one level up in the directory tree.
  • ls  :- lists files and directories.
    • ls / lists the contents of / (root) directory.
    • ls -l will lists in long format. This command shows properties of files and directories.
    • ls -a will list all files including hidden files which starts with a period (.).
    • ls -ld will show properties of the directory.
  • cat  :- catinates files. Create files and also show contents of files.
    • cat 123.txt dumps the contents of the file 123.txt.
    • cat > xyz creats new file xyz. You can write to the file and save using ctrl+d.

  • mkdir  :- creates a new directory.
  • cp :- copies files
  • mv :- moves and rename files.
  • rm :- remove files.
  • touch :- create a blank file.
  • stat :-  reveals the statistics of a file.
  • find :- finds files using search pattern.
    • find / -name filename will search the file named filename in the / directory/
  • alias :- return/set aliases for command.
  • more/less :- display one page at a time.
  • head :- display opening lines of a file.
  • tail :- display cloasing lines of a file.
  • wc :- counts words and optionally lines and characters in a file.
  • grep :- search for text in a file.
  • su :- to switch user.
  • man command_name  :- open manual for that command.
 These are the the basic Linux commands. But there are a lot more commands, you will learn command while using it, it will take time but more you work in linux more you learn.

NOTE : There are many options which can be used with these commands or other commands. Always view man pages of command to find different options. I think using man command is very good habit.

Comments

Popular posts from this blog

Red Hat Enterprise version list

Red Hat Enterprise Linux 6 Release/Update General Availability Date redhat-release Errata Date* Kernel Version RHEL 6 Update 4 TBA TBA TBA RHEL 6 Update 3 2012-06-20 2012-06-19 RHSA-2012-0862 2.6.32-279 RHEL 6 Update 2 2011-12-06 2011-12-06 RHEA-2011:1743 2.6.32-220 RHEL 6 Update 1 2011-05-19 2011-05-19 RHEA-2011:0540 2.6.32-131.0.15 RHEL 6 GA 2010-11-09 - 2.6.32-71 Codename: Santiago (based on a mix of Fedora 12, Fedora 13, and several modifications) Red Hat Enterprise Linux 5 Release/Update General Availability Date redhat-release Errata Date* Kernel Version RHEL 5 Update 9 TBA TBA TBA RHEL 5 Update 8 02/20/2012 02/20/2012 RHEA-2012:0315 2.6.18-308 RHEL 5 Update 7 07/21/2011 07/20/2011 RHEA-2011:0977 2.6.18-274 RHEL 5 Update 6 01/13/2011 01/12/2011 RHEA-2011:0020 2.6.18-238 RHEL 5 Update 5 03/30/2010 03/30/2010 RHEA-2010:0207 2.6.18-194 RHEL 5 Update 4 09/02/2009 09/02/2009 ...

Installation Red Hat Enterprise & make standered partition

First of all select DVD and reboot your computer. After Booting from DVD you will get below screen. Select  Install or Upgrade an Existing System and press Enter. If you get the following screen then let Anaconda take another step. Select your preferred  Language and Select  Keyboard Layout . In Following Screen you will be able to see 4 Installation Methods, Let me explain Methods here:- Local CD/DVD – It is obvious that If you use CD/DVD media then Choose this option. Hard Drive – Select this if you have dumped your source into any other Linux partition. NFS Directory – You can select this option if you have configured NFS server. URL – Select this if you want to install using FTP or HTTP Source link. So for step by step installation of RHEL 6 I had  Local CD/DVD Installation Method. If you are not sure about your media then select  OK to verify else select  Skip . If your media is fine till now it will take ...

MBR, Primary, Extended & Logical partition in Red Hat

MBR, Primary, Extended & Logical partition in Red Hat Hard disk and storage device are normally divided up into smaller chunks called partitions. So that different parts of it can be formatted with different file system or used for different purposes. For example, one partition could contain user home directories while another could contain system data and logs; by placing the data in two separate file system on two separate partitions, even if a user fills up the home directories partition with data, the system data partition may have space. Most Red Hat Enterprise Linux system on the x86 and x86-64 processor architectures use the MBR partitioning format for their hard disk. This is the same format that is used by most Microsoft Windows systems, and dates back to the IBM PC.                              Storage device: /dev/sda In this format, the first sector of the disk is reser...