Solved

some linux command questions

Posted on 2004-04-15
8
312 Views
Last Modified: 2010-04-20
pls can someone help me to understand some of the next command questions
tks very much


question 1:
cat /etc/passwd
ljespers:x:502:503:lotte_jespers:/users/lotte:/bin/bash
kjespers:x:503:504:karel_jespers:/users/karel:/bin/bash

what does the :x: means
what does the 502:503 out of the ljespers line mean
the /bin/bash <= does this indicated the startup directory or ....

question 2:
ls -la
drwxr-x---    3 kjespers testgroup     4096 Apr 11 08:30 .kde
-rwxrwxrwx    1 kjespers testgroup      231 Apr 11 12:42 test

what is the meaning off the first charcater of each line
d
and
-

question 3:
kill -9 2932
process with id 2932 is killed
what does this -9 means

question 4:
use of the alias command
alias = RM = 'rm-i'
??
0
Comment
Question by:karel_jespers
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 6

Assisted Solution

by:karlwilbur
karlwilbur earned 350 total points
Comment Utility
"what does the :x: means"
Usually the password is stored here but an "x" means somehting elas. The "x" is a place holder. It indicates that shadow passwords are being used and the users password in found in the /etc/shadow file.

"what is the meaning off the first charcater of each line 'd' and '-'"
The "d" means that it is a directory and "-" meand that it's not a directory

"what does this -9 means"
the "-9" indicates a signel to be sent to the process rather that the default "TERM" signal
Some of the more commonly used signals:
     1           HUP (hang up)
     2           INT (interrupt)
     3           QUIT (quit)
     6           ABRT (abort)
     9           KILL (non-catchable, non-ignorable kill)
     14           ALRM (alarm clock)
     15           TERM (software termination signal)
see man kill

"use of the alias command"
alias sets a string of characters to execute a command:
like:
alias youdienow = 'kill -9'
would make so that "kill -9 httpd" would execute if you typed "youdienow httpd".

Does this answer your questions?
0
 
LVL 12

Expert Comment

by:stefan73
Comment Utility
Hi karel_jespers,
> what does the :x: means
The password is shadowed in /etc/shadow against dictionary attacks.

2.
>what is the meaning off the first charcater of each line d and -
d=directory. - = ordinary file. There are other special flags, such as s for suid.

3. Part of Unix interprocess communication are signals. kill sends a signal to a process. -9 or -SIGKILL is a signal to kill a process. A SIGKILL cannot be caught or avoided, it always immediately kills a process. Other signals include SIGTERM (kill's default signal) and error signals, such as SIGSEGV, which indicates a memory access error.

do "man kill" in the shell to see what kill is about.

4. Aliases are "shorthand" for command sequences, or to give default parameters to a command. Example (bash/ksh):
alias ll='ls -ltr'
So when you type "ll" you'll get "ls -ltr" instead. Saves typing :-)

Cheers,
Stefan
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
1) long ago the password was encoded in place of the x,
now it is hidden in the /etc/shadow file
The idea was that passwords could no longer be read and re-calculted on super computers.

2) d for directory, - for ordinary file (there's more than that!)

3)  kill sends a SIGNAL to a process,  default = 15 (easy termination) , 9 = stop immediately.


;JOOP!
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
I'm too slow in typing ......
;JOOP!
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
Comment Utility
(1) The "x" is a place holder for the password field and indicates that the real password will be found in /etc/shadow. "502:503" is the UID and GID, respectively for that account. /bin/bash if the login shell for that user. The complete definition of a line from the passwd file is:

login-name : password : UID : GID : Gecos/Full Name : home-dir     : login shell
ljespers        :         x        : 502 : 503 : lotte_jespers         : /users/lotte : /bin/bash

(2) The first character of the perms field of a long directory listing can be one of:

-    no special attributes
d   indicates a directory
l    symbolic link
s    socket
b   block special file
c    character special file

(3) 'kill -9 some-pid' says to send the process specified a SIGKILL signal. SIGKILL is sort of a "terminate with extreme prejudice" and is the last resort short of a reboot in killing a process. The preferred method is to use 'kill some-pid' which sends a SIGQUIT signal. That allows the process to go through any shutdown processing that it might ordinarily need to do. A SIGKILL may not allow that.

(4) The alias "RM='rm -i'" sets up a command substition so that when a user execute 'RM some-file' the actual command executed becomes 'rm -i some-file', which does an interactive delete (see 'man rm' for details).
0
 
LVL 12

Expert Comment

by:stefan73
Comment Utility
sciuriware,
> I'm too slow in typing ......
Ask me about it ;)

Stefan
0
 
LVL 6

Expert Comment

by:karlwilbur
Comment Utility
WOW! What a response.  I think that we've managed to really answer this question.

karel_jespers,

Do you get it now?  Any more questions? If so, feel free to ask. As you can see there are a lot of people waiting to help.

-Karl
0
 
LVL 6

Author Comment

by:karel_jespers
Comment Utility
tks a lot
linux people are GREAT !
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now