Solved

file or directory

Posted on 2013-06-03
7
236 Views
Last Modified: 2013-06-07
-rwxr-x--- 1 root root    72932 Jan 16  2007 useradd

How will we find user add is a file or directory..
0
Comment
Question by:walkerdba
7 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39215471
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
 
LVL 4

Expert Comment

by:AshutoshKumar
ID: 39215483
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 250 total points
ID: 39215768
you can always use the command file , e.g.

file useradd
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 21

Accepted Solution

by:
Mazdajai earned 250 total points
ID: 39216572
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
 

Author Comment

by:walkerdba
ID: 39224439
ok
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 39224935
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

9 Experts available now in Live!

Get 1:1 Help Now