Appendix A. Basic Linux for Non-Linux Users

In this appendix, we give a short introduction to the Linux filesystem for Windows (and Mac nonterminal) users. You will need this information because your application will be hosted on a Linux machine (Red Hat Enterprise Linux, in particular). One shortcut you should know right away is that the tilde character (~) is an alias for your home directory. The operating system will expand that symbol to the path to your home directory.

Listing Directory Contents

To list the contents of a folder, you can execute the ls command. This will show the contents of the directory, but will not display any information about permissions or which items are directories. To view the permissions for items, use the command ls -l. Use ls -lh for human-readable file sizes, or ls -lha to list all files, including hidden files. The output should look something like this:

[me@localhost tmp]$ ls -lha
total 92K
drwxrwxr-x.  3 me me 4.0K Jun 28 06:28 .
drwx------. 58 me me 4.0K Jun 28 03:14 ..
drwxrwxr-x.  2 me me 4.0K Jun 28 06:28 a_directory
-rw-rw-r--.  1 me me  78K Jun 28 06:28 example.txt

Reading from left to right, the first 11 characters represent the file type and permissions. If the first character is a d, it means the line refers to a directory. The next three characters are the permissions for the user, the following three are the permissions for the group, and the next three are the permissions for the “world.” Each character represents a differently capability: ...

Get Getting Started with OpenShift now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.