Solved

file or directory

Posted on 2013-06-03
7
238 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.

809 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