some linux command questions

Posted on 2004-04-15
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

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

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'
Question by:karel_jespers
  • 2
  • 2
  • 2
  • +2

Assisted Solution

karlwilbur earned 350 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:
alias youdienow = 'kill -9'
would make so that "kill -9 httpd" would execute if you typed "youdienow httpd".

Does this answer your questions?
LVL 12

Expert Comment

ID: 10834557
Hi karel_jespers,
> what does the :x: means
The password is shadowed in /etc/shadow against dictionary attacks.

>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 :-)

LVL 24

Expert Comment

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.

LVL 24

Expert Comment

ID: 10834604
I'm too slow in typing ......
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

LVL 40

Accepted Solution

jlevie earned 50 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).
LVL 12

Expert Comment

ID: 10834646
> I'm too slow in typing ......
Ask me about it ;)


Expert Comment

ID: 10834692
WOW! What a response.  I think that we've managed to really answer this question.


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.


Author Comment

ID: 10834795
tks a lot
linux people are GREAT !

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change time in cron 4 67
linux boot fsck problem 3 61
Error installing extension Linux 4 59
How to update  and reset admin password for Linux 5 44
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

920 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

16 Experts available now in Live!

Get 1:1 Help Now