Extreme Beginner

Hi everyone,

I just started my ERP Systems Administration class a couple weeks ago and we're focusing on Unix/Linux and SAP systems. For Unix/Linux we're using Putty.

This teacher is trying to make the class as close to as real as a job as he can. The class is at 9 AM (he teaches an 8 AM class right before this) and he doesn't really give any instruction as to how to accomplish anything. He gives us homework and groupwork with things to be done but no how to or reference material. In class he's lectured a little bit on commands and shortcuts in linux/unix (most of it went over my head) but that's about all the instruction we get.

So my questions are probably so basic I should be embarrassed, but I currently know next to nothing so please bare with me. And to be clear I'm not complaining about the style of the class (yet lol) just letting you know why my questions are so elementary.

cd /bin 
pwd
ls -l

After entering the code above one of the questions is:
What is the meaning of having a �d�, �l� or �-�as the first character in the display from the above command?

As I understand it, the code is taking me to the bin directory (not sure what that is) and pwd is simply displaying the directory I'm currently in. ls -l is to list files and directories, I assume -l is to display the files and directories in "l" (whatever "l" is).

With that being said, I believe a "d" as the first character means that the file is a directory or sub-directory. Files starting with "l" seem to have text in the far right column colored blue while files starting with "-" have text in the far right column colored green. And some of the data in the far right column for the "l" files point farther right to green data.

What does all of this tell me? I have no idea.

Can anyone help me out with this?

d = directory (folder)
l = symbolic link (reference to a file or folder somewhere else, thus the arrow -> to whatever it point to)

pwd = print working dir (yes, the directory you are in)
ls -l = ls is "list" files and -l is for long (more verbose) format.

1 Like

The most important thing you should learn how to use is the "man" command (short for manual).

if you want to find out about a command and what it does, issue the following commands and learn what is presented. Navigation within the man pages is with up and down arrows on the keyboard:

man man
man cd
man pwd
man ls
1 Like

Example first column of ls -l

File type: d== directory l== link
|
|
|
|
|
_
drwxrwxr-x
 ___   ___
  | ___ |
  |  |  |
  |  |  (World) other permissions  r,w,x, and -
  |  group permissions r,w,x, and -
  owner permissions: r == read, w== write, x ==execute  - == permission denied

Permission bits can also be written as octal numbers.

0 (no permission)
1 execute
2 write
3 execute + write
4 read
5 read + execute
6 read + write
7 read + write + execute

So 755 is
owner read, write, execute
group read, execute
other read, execute

1 Like

When the "file" is actually a "directory" the "execute" permissions become "search directory" permissions, so Jim's table looks something like this, for directories:

0 (no permission)
1 search
2 write
3 search + write
4 read
5 read + search
6 read + write
7 read + write + search
1 Like

Thank you all, every explanation was very helpful.For the permissions issue, I found an explanation online that I just couldn't make sense of but Jim did a fantastic job.

File type: d== directory l== link
|
|
|
|
|
_
drwxrwxr-x
 ___   ___
  | ___ |
  |  |  |
  |  |  (World) other permissions  r,w,x, and -
  |  group permissions r,w,x, and -
  owner permissions: r == read, w== write, x ==execute  - == permission denied

So to confirm: In the code above from Jim's explanation, the "d" in "drwxrwxr-x" means "Directory", and if that line were instead "lrwxrwxr-x" the "l" would mean "Symbolic Link", and if that line were instead "-rwxrwxr-x" the "-" would mean "Permission Denied"?

No. The first character indicates the file type:

           b     Block special file.
           c     Character special file.
           d     Directory.
           l     Symbolic link.
           s     Socket.
           p     FIFO (pipe).
           -     Regular file.

Some systems have additional file types that would be indicated by other characters in the 1st column.

1 Like