Solved

file or directory

Posted on 2013-06-03
7
241 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
[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
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 40

Assisted Solution

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

file useradd
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

MongoDB Through a MySQL Lens

This article looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.

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.…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

628 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