?
Solved

some linux command questions

Posted on 2004-04-15
8
Medium Priority
?
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 6

Assisted Solution

by:karlwilbur
karlwilbur earned 1400 total points
ID: 10834556
"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
ID: 10834557
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
ID: 10834590
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 24

Expert Comment

by:sciuriware
ID: 10834604
I'm too slow in typing ......
;JOOP!
0
 
LVL 40

Accepted Solution

by:
jlevie earned 200 total points
ID: 10834640
(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
ID: 10834646
sciuriware,
> I'm too slow in typing ......
Ask me about it ;)

Stefan
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10834692
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
ID: 10834795
tks a lot
linux people are GREAT !
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

752 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