Posts Tagged ‘red hat linux commands’

Red Hat Linux Commands – How to Understand Linux Directory and File Listings 

Interpreting Linux Directory and File Listings – From the Output of the Linux ls Command

In this linux tutorial we will learn how to running the Linux ls command at the Linux command line prompt shows a listing of directories and files.

The following is an example of a listing at the shell prompt of a directory named bin:

  • drwxr-x— 22 root root 4096 May 22 16:14 bin

The name of the directory (bin) appears at the far right.

At the left of this name is the time (16:14). If the directory were not created this year, the year would appear in place of the time. Next at the left is the date (May 22). At the left is the size of the directory, which is 4,096 bytes (4 K).

At the far left is a “d” and this indicates that the item is a directory.

The other items shown above, such as “rwxr-x— 22 root root”, are permissions.

The following is a Linux ls command output example of a file named grep.1.gz:

  • -rw-r–r– 1 root root 5907 Jul 17 2007 grep.1.gzThe name of the file appears at the far right (grep.1.gz).

At the left of the name is the date that the file was created (July 17, 2007). At the left of that is the size of the file, which is 5,907 bytes (approximately 5.9 K).

At the far left is a “-“. This indicates that the item is a file.

The above file was created in 2,007. If the file was created this year, then the time that the file was created, in the form of hh:mm, would appear in place of the year.

When you run ls command and use the -l option, you see a series of characters at the left of each item in the directory listing. The table below shows the meaning of the far left character in a directory listing.

The Leftmost Characters in a Listing from the Output of the Linux ls Command

When using the -l option of the ls command, the - (dash) for file and the d for directory appear most often in the list that is output when the ls command is run.

Remember that directory names have a “d” at the far left of them and files have a “-“.

The Linux concepts shown above apply to Slackware, Red Hat, Ubuntu, Fedora, and Debian Linux – and also ALL Linux distributions.

By the way…do you want to learn exactly how to use Linux and run Linux commands for Linux System Administration and get real, practical Linux training experience by running hundreds of examples of Linux commands? Stay tuned as more linux commands training tips will coming. speak soon.

Other related articles:

Technorati Tags: , , ,

Red Hat Linux Ls Command

Image representing Red Hat as depicted in Crun...
Image via CrunchBase

Red Hat Linux – Using the Linux ls Command to List the Contents of A Directory

The Linux ls command is one of the most commonly used commands. It is used to list the contents of a directory and show the files and other directories in a directory.

In the Windows world, a Linux directory is called a Windows folder.

There are lots of options that can be used with the ls command to see different information on the files and directories that are in a directory.

Running the Linux ls Command with Examples of Options

You can run the following Linux ls command examples at the command line prompt to get real, practical commands training experience!

Linux Commands Training Tips: When you run the ls commands below, with the examples of ls command options and parameters, don’t type in the $ (dollar sign) prompt. Just type in the commands shown at the right of the $ sign.

Run the ls command without any options to see the contents of the current directory.

    $ ls

Run the ls command with the -l option for “long” option to see a longer and more detailed listing of the current directory.

    $ ls -l

Now run the command below and add the -a option to show “all” files (which will cause the normally hidden files to appear) in the current directory.

    $ ls -la

The ls command below shows the contents of the root directory. Many of the directory names that appear in the / (root) directory are common to all Linux distros. Notice that a directory named sbin (for superuser binaries) appears.

    $ ls /

Now list the contents of the sbin directory.

    $ ls /sbin

Now get a “long” listing of the sbin directory.

    $ ls -l /sbin

The next ls command shows the contents of sbin sorted by size (due to the upper case S option), with the largest file at the top. You can see the size of items in the fifth column from the left. And you can click on the scroll bar on the right side of the terminal emulation window to scroll up!

    $ ls -lS /sbin

Now see the files in reverse order, due to the -r option.

    $ ls -lSr /sbin

And now add the h option for “human readable” to cause a file with a size of 7,169 to appear as 7k.

    $ ls -lSrh /sbin

The ls command is one of the GNU Linux commands, which are the “core” Linux commands that are common to ALL Linux distributions. Many people start considering on using free linux as option to their operating system. To learn linux red hat commands you can choose fedora to get the enterprise feel on linux.

By learning the GNU Linux commands, you learn how to use ALL Linux versions!

By the way…do you want to learn exactly how to use Linux and run red hat Linux commands for Linux System Administration and get real, practical Linux training experience by running hundreds of examples of Linux commands? Stay tune as I will add more linux commands in  this web site.

Priyo Wibowo | IT Consultant

Other related articles:

  • Comment on Painless dual-booting with Red Hat Enterprise Linux 5 … – I have tried installing both on my macbook pro (unibody) and my mac pro… still I cant seem to get it work. I cant see the Linux (or the ironic-windows) option with mac’s built-in chooser. I only see “Macintosh HD”… …
  • How to change the hostname of a Linux system | MDLog:/sysadmin – How to change the hostname of a Linux system. Normally we will set the hostname of a system during the installation process. Many peoples don’t care about this, and don’t change the hostname even if for example this was set to something …
  • red hat 5/centos 5.1 and microsoft virtual server 2005 r2 sp1 – parallels desktop for mac and vmware fusion (mac)/workstation (pc) don’t seem to have issues with the current generation of linux distros. but, microsoft’s virtual pc and virtual server do, unfortunately. and, since most of my work is …
  • Comment on 250+ Computer eBooks Download Links by Feeling Tired … – Wow. Great collection, thanks for the info.
  • Red Hat Magazine | Professional audio with Fedora Core 6 – This is the first in a series of articles that aim to provide some guidance on how to get started making use of the professional audio tools and capabilities of a Fedora Core system. This article covers playing notes using the JACK …
  • Red Hat Magazine | Solutions from the road: Red Hat Enterprise … – One of the many uses of having a Red Hat Consultant on site is to provide “best practices” in regard to using or deploying Red Hat Linux or any of Red Hat’s applications. These best practices come from the way a product was written as …
  • Red Hat Magazine | Book review: Live Linux CDs: Building … – Normally, a computer has an operating system installed on the hard drive. When the computer powers up, the hard drive reads the operating system, loads it into memory, and the system is ready to go. With a live CD, the operating system …
  • patent infringement lawsuit filed against red hat & novell – earlier this month, ballmer reiterated his stance on patents and linux: microsoft chief executive steve ballmer has warned users of red hat linux that they will have to pay microsoft for its intellectual property. …
  • Google Talk on Linux – Google Talk works fine with a Jabber compatible IM client such as GAIM but out of curiousity I tried to install the Windows client so I could use the voice function. Alas, my version of Wine isn’t up to the task. No matter what path I enter in the second dialog the INSTALL button is always greyed out! Others have had more luck installing, but the application doesn’t run yet.
  • Found in a Red Hat kernel spec file – Journalist, # # The changelog below is a list of modifications that have been made # to the kernel at one time. By no means does this text reflect any # official position of Red Hat, Inc. nor does any text reflect what # is in the actual current kernel, due to the fact that we actually log # tests and one-off builds as well.
  • tecosystems » Red Hat v Ubuntu: The Mobily Editorial – As for the first South African in space, Mark’s comments were almost to the letter what I expected to hear. Like MySQL’s Marten Mickos, Shuttleworth can play the role of diplomat when it suits him and in this case it’s the right move. Embracing Mobily’s comments would be premature at this point, because candidly Ubuntu is not (yet) in a position to overtly challenge the enterprise strength of Red Hat, hence the Kung Fu style humility.
  • Google.Aprendiendo un poco más. « Diario de un aprendiz. – O también: site: edu, que devuelve solo resultados de webs en el dominio .edu. § Link: devuelve una lista de páginas que apuntan a una URL concreta. No hace falta teclear http://. Por ejemplo: link:www. uniovi.es. Esta búsqueda devolverá un listado de …. [if !supportLists]–> – Intitle:”Test Page for the SSL/TLS-aware Apache installation” “Hey, it worked!” – Intitle:”Test Page for the Apache Web Server on Red Hat Linux” …
  • Navigating the Security Practice Landscape – The course itself uses Red Hat Linux 9. There are discussions and a lab. The 10 Principles [Rogers 04] covered in the class are. Survivability is an enterprise-wide concern. Everything is data. Not all data is of equal value to an …
Enhanced by Zemanta

Technorati Tags: , , ,