Visit The New, Modern Unix Linux Community


Extreme Beginner


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Extreme Beginner
# 1  
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.

Code:
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?
# 2  
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.
This User Gave Thanks to cjcox For This Post:
# 3  
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:
Code:
man man
man cd
man pwd
man ls

This User Gave Thanks to [MA]Flying_Meat For This Post:
# 4  
Example first column of ls -l
Code:
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.
Code:
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

Last edited by jim mcnamara; 09-05-2014 at 05:46 PM..
This User Gave Thanks to jim mcnamara For This Post:
# 5  
When the "file" is actually a "directory" the "execute" permissions become "search directory" permissions, so Jim's table looks something like this, for directories:

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

This User Gave Thanks to Neo For This Post:
# 6  
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.

Code:
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"?
# 7  
No. The first character indicates the file type:
Code:
           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.
This User Gave Thanks to Don Cragun For This Post:

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #941
Difficulty: Medium
A ping of death is a type of attack on a computer system that involves sending a malformed or otherwise malicious ping to a computer.
True or False?

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Beginner - What Should I Do First?

Hi people.... I have just started to learn unix.I want to know which version of Unix to install plus how to install it.I need to practise and make myself aware of how unix works.My thread is from an educational point of view.Also please feel free to give your suggestions as I am... (3 Replies)
Discussion started by: amit.kanade1983
3 Replies

2. Shell Programming and Scripting

Beginner Help

I need to write a script to test a nsort c program. I have written 8 .txt files with different cases. Also 8 .txt files with expected outcome. The shell I have written always "test pass" for the first case but always "fail" for the rest... Here is a portion of my code (as I still don't know how to... (5 Replies)
Discussion started by: thibodeau
5 Replies

3. UNIX for Dummies Questions & Answers

Beginner Help

hi guys, i have a DEl xps laptop cor 2 duo 2.2 i have vista installed on it i want to install a dual Boot UNIX on it.. can some one guide me ...cause i m tottaly new to UNIX i want to install unix on that laptop along with Vista.... thx any help would be deeply appreciated (sorry if i... (5 Replies)
Discussion started by: Farhan082
5 Replies

Featured Tech Videos