• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

file or directory

-rwxr-x--- 1 root root    72932 Jan 16  2007 useradd

How will we find user add is a file or directory..
0
walkerdba
Asked:
walkerdba
2 Solutions
 
woolmilkporcCommented:
See the first column.

A dash ( "-") indicates a regular file.

A directory is indicated by "d" in the first colum.

Likewise, "l" indicates a soft (symbolic) link, "s" a socket, "b" a block special file, "c" a character special file and "p" indicates a FIFO named pipe.

ls -l | grep ^-

lists all regular files,

ls -l | grep ^d

lists all directories etc.
0
 
AshutoshKumarCommented:
0
 
omarfaridCommented:
you can always use the command file , e.g.

file useradd
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
MazdajaiCommented:
You can use file (man file) to tell if it is a file or directory, example -

file abc.pem 
abc.pem: ASCII text, with CRLF line terminators
file ec/
ec/: directory

Open in new window


Edited: looks like omarfarid mentioned already.
0
 
walkerdbaAuthor Commented:
ok
0
 
omarfaridCommented:
If you feel that you need to change the accepted answer, you can request attention of an administrator who can reopen the question for you.

You can always choose / split points among multiple answers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now