无法理解linux命令的输出

时间:2012-09-07 10:59:19

标签: android linux linux-kernel ls proc

我是linux的新手,实际上我正在使用android ndk(也是新的)我想知道是否有人可以解释以下命令的含义“ls -l / proc / / fd /”和“ ls -l / data / data“。 当我运行以下命令“ls -l / proc / / fd /”时,我得到以下输出: -

lr-x------ root     root              2012-09-07 15:56 4 -> /dev/__properties__ (deleted)
lrwx------ root     root              2012-09-07 15:56 5 -> socket:[257]
lrwx------ root     root              2012-09-07 15:56 6 -> socket:[259]
lrwx------ root     root              2012-09-07 15:56 7 -> socket:[260]
lrwx------ app_4    app_4             2012-09-07 15:56 0 -> /dev/null
lrwx------ app_4    app_4             2012-09-07 15:56 1 -> /dev/null
lrwx------ app_4    app_4             2012-09-07 15:56 2 -> /dev/null
l-wx------ app_4    app_4             2012-09-07 15:56 3 -> /dev/log/main
l-wx------ app_4    app_4             2012-09-07 15:56 4 -> /dev/log/radio
l-wx------ app_4    app_4             2012-09-07 15:56 5 -> /dev/log/events
lr-x------ app_4    app_4             2012-09-07 15:56 6 -> /system/framework/core.jar
lr-x------ app_4    app_4             2012-09-07 15:56 7 -> /system/framework/bouncycastle.jar
lr-x------ app_4    app_4             2012-09-07 15:56 8 -> /dev/__properties__ (deleted)
lrwx------ app_4    app_4             2012-09-07 15:56 9 -> /dev/binder
lr-x------ app_4    app_4             2012-09-07 15:56 10 -> /system/framework/ext.jar
lr-x------ app_4    app_4             2012-09-07 15:56 11 -> /system/framework/framework.jar
lr-x------ app_4    app_4             2012-09-07 15:56 12 -> /system/framework/android.policy.jar
lr-x------ app_4    app_4             2012-09-07 15:56 13 -> /system/framework/services.jar
lr-x------ app_4    app_4             2012-09-07 15:56 14 -> /system/framework/core-junit.jar
lr-x------ app_4    app_4             2012-09-07 15:56 15 -> /system/framework/framework.jar
lr-x------ app_4    app_4             2012-09-07 15:56 16 -> /system/fonts/DroidSans.ttf
lr-x------ app_4    app_4             2012-09-07 15:56 17 -> /system/framework/core.jar
lr-x------ app_4    app_4             2012-09-07 15:56 18 -> /dev/urandom
lr-x------ app_4    app_4             2012-09-07 15:56 19 -> /system/framework/framework-res.apk
l-wx------ app_4    app_4             2012-09-07 15:56 20 -> /dev/cpuctl/tasks
lrwx------ app_4    app_4             2012-09-07 15:56 21 -> socket:[616]
lr-x------ app_4    app_4             2012-09-07 15:56 22 -> pipe:[617]
l-wx------ app_4    app_4             2012-09-07 15:56 23 -> pipe:[617]
lrwx------ app_4    app_4             2012-09-07 15:56 24 -> socket:[620]
l-wx------ app_4    app_4             2012-09-07 15:56 25 -> /dev/cpuctl/bg_non_interactive/tasks
lr-x------ app_4    app_4             2012-09-07 15:56 26 -> pipe:[632]
l-wx------ app_4    app_4             2012-09-07 15:56 27 -> pipe:[632]
lrwx------ app_4    app_4             2012-09-07 15:56 28 -> anon_inode:[eventpoll]
lr-x------ app_4    app_4             2012-09-07 15:56 29 -> /system/app/OpenWnn.apk
lr-x------ app_4    app_4             2012-09-07 15:56 30 -> /system/app/OpenWnn.apk
lrwx------ app_4    app_4             2012-09-07 15:56 31 -> /dev/ashmem
lrwx------ app_4    app_4             2012-09-07 15:56 32 -> /dev/ashmem
lr-x------ app_4    app_4             2012-09-07 15:56 33 -> /system/app/OpenWnn.apk
lrwx------ radio    radio             2012-09-07 15:56 0 -> /dev/null
lrwx------ radio    radio             2012-09-07 15:56 1 -> /dev/null
lrwx------ radio    radio             2012-09-07 15:56 2 -> /dev/null
l-wx------ radio    radio             2012-09-07 15:56 3 -> /dev/log/main
l-wx------ radio    radio             2012-09-07 15:56 4 -> /dev/log/radio
l-wx------ radio    radio             2012-09-07 15:56 5 -> /dev/log/events
lr-x------ radio    radio             2012-09-07 15:56 6 -> /system/framework/core.jar
lr-x------ radio    radio             2012-09-07 15:56 7 -> /system/framework/bouncycastle.jar
lr-x------ radio    radio             2012-09-07 15:56 8 -> /dev/__properties__ (deleted)
lrwx------ radio    radio             2012-09-07 15:56 9 -> /dev/binder
lr-x------ radio    radio             2012-09-07 15:56 10 -> /system/framework/ext.jar
lr-x------ radio    radio             2012-09-07 15:56 11 -> /system/framework/framework.jar
lr-x------ radio    radio             2012-09-07 15:56 12 -> /system/framework/android.policy.jar
lr-x------ radio    radio             2012-09-07 15:56 13 -> /system/framework/services.jar
lr-x------ radio    radio             2012-09-07 15:56 14 -> /system/framework/core-junit.jar
lr-x------ radio    radio             2012-09-07 15:56 15 -> /system/framework/framework.jar
lr-x------ radio    radio             2012-09-07 15:56 16 -> /system/fonts/DroidSans.ttf
lr-x------ radio    radio             2012-09-07 15:56 17 -> /system/framework/core.jar
lr-x------ radio    radio             2012-09-07 15:56 18 -> /dev/urandom
lr-x------ radio    radio             2012-09-07 15:56 19 -> /system/framework/framework-res.apk
l-wx------ radio    radio             2012-09-07 15:56 20 -> /dev/cpuctl/tasks
lrwx------ radio    radio             2012-09-07 15:56 21 -> socket:[621]
lr-x------ radio    radio             2012-09-07 15:56 22 -> pipe:[622]
l-wx------ radio    radio             2012-09-07 15:56 23 -> pipe:[622]
lrwx------ radio    radio             2012-09-07 15:56 24 -> socket:[625]
l-wx------ radio    radio             2012-09-07 15:56 25 -> /dev/cpuctl/bg_non_interactive/tasks
lr-x------ radio    radio             2012-09-07 15:56 26 -> pipe:[638]
l-wx------ radio    radio             2012-09-07 15:56 27 -> pipe:[638]
lrwx------ radio    radio             2012-09-07 15:56 28 -> anon_inode:[eventpoll]
lr-x------ radio    radio             2012-09-07 15:56 29 -> /system/app/Phone.apk
lr-x------ radio    radio             2012-09-07 15:56 30 -> /system/app/Phone.apk
lrwx------ radio    radio             2012-09-07 15:56 31 -> /dev/ashmem
lrwx------ radio    radio             2012-09-07 15:56 32 -> /dev/ashmem
lr-x------ radio    radio             2012-09-07 15:56 33 -> /system/app/Phone.apk
lr-x------ radio    radio             2012-09-07 15:56 34 -> /system/app/TelephonyProvider.apk
lr-x------ radio    radio             2012-09-07 15:56 35 -> /system/app/TelephonyProvider.apk
lr-x------ radio    radio             2012-09-07 15:56 36 -> /system/app/TelephonyProvider.apk
lrwx------ radio    radio             2012-09-07 15:56 37 -> /data/data/com.android.providers.telephony/databases/telephony.db
lr-x------ radio    radio             2012-09-07 15:56 38 -> pipe:[730]
l-wx------ radio    radio             2012-09-07 15:56 39 -> pipe:[730]
lrwx------ radio    radio             2012-09-07 15:56 40 -> anon_inode:[eventpoll]
lrwx------ radio    radio             2012-09-07 15:56 41 -> socket:[731]
lr-x------ radio    radio             2012-09-07 15:56 42 -> pipe:[750]
l-wx------ radio    radio             2012-09-07 15:56 43 -> pipe:[750]
lrwx------ radio    radio             2012-09-07 15:56 44 -> anon_inode:[eventpoll]
lr-x------ radio    radio             2012-09-07 15:56 45 -> pipe:[753]
l-wx------ radio    radio             2012-09-07 15:56 46 -> pipe:[753]
lrwx------ radio    radio             2012-09-07 15:56 47 -> anon_inode:[eventpoll]
lr-x------ radio    radio             2012-09-07 15:56 48 -> pipe:[754]
l-wx------ radio    radio             2012-09-07 15:56 49 -> pipe:[754]
lrwx------ radio    radio             2012-09-07 15:56 50 -> anon_inode:[eventpoll]
lr-x------ radio    radio             2012-09-07 15:56 51 -> pipe:[756]
l-wx------ radio    radio             2012-09-07 15:56 52 -> pipe:[756]
lrwx------ radio    radio             2012-09-07 15:56 53 -> anon_inode:[eventpoll]
lr-x------ radio    radio             2012-09-07 15:56 54 -> pipe:[762]

当我运行“ls -l / data / data”命令时,我得到以下输出: -

drwxr-x--x system   system            2012-08-10 17:07 com.android.providers.set
tings
drwxr-x--x system   system            2012-08-10 17:07 com.android.settings
drwxr-x--x app_13   app_13            2012-08-10 17:07 com.android.launcher
drwxr-x--x app_6    app_6             2012-08-10 17:07 com.android.providers.con
tacts
drwxr-x--x system   system            2012-08-10 17:07 com.android.providers.sub
scribedfeeds
drwxr-x--x app_0    app_0             2012-08-10 17:07 com.android.providers.drm

drwxr-x--x app_14   app_14            2012-08-10 17:07 com.android.customlocale
drwxr-x--x app_16   app_16            2012-08-10 17:07 com.android.spare_parts
drwxr-x--x app_17   app_17            2012-08-10 17:07 com.android.speechrecorde
r
drwxr-x--x app_18   app_18            2012-08-10 17:07 com.android.term
drwxr-x--x app_0    app_0             2012-08-10 17:08 com.android.providers.dow
nloads
drwxr-x--x app_19   app_19            2012-08-10 17:08 com.android.deskclock
drwxr-x--x app_28   app_28            2012-08-10 17:08 com.android.email
drwxr-x--x app_0    app_0             2012-08-10 17:08 com.android.providers.med
ia
drwxr-x--x app_4    app_4             2012-08-10 19:57 jp.co.omronsoft.openwnn
drwxr-x--x app_6    app_6             2012-08-13 14:54 com.android.providers.use
rdictionary
drwxr-x--x radio    radio             2012-08-10 17:07 com.android.providers.tel
ephony
drwxr-x--x app_20   app_20            2012-08-28 19:29 com.android.browser
drwxr-x--x app_21   app_21            2012-08-10 17:07 com.android.packageinstal
ler
drwxr-x--x app_22   app_22            2012-08-10 17:07 com.android.certinstaller

drwxr-x--x app_23   app_23            2012-08-10 17:07 com.android.netspeed
drwxr-x--x system   system            2012-08-10 17:07 com.android.systemui
drwxr-x--x app_24   app_24            2012-08-10 17:07 com.android.protips
drwxr-x--x app_25   app_25            2012-08-10 17:07 com.android.camera
drwxr-x--x app_26   app_26            2012-08-10 17:07 com.android.sdksetup
drwxr-x--x app_27   app_27            2012-08-10 17:07 com.android.calculator2
drwxr-x--x app_29   app_29            2012-08-10 17:07 com.android.development
drwxr-x--x app_1    app_1             2012-08-10 17:07 com.android.htmlviewer
drwxr-x--x app_3    app_3             2012-08-10 17:07 com.android.defcontainer
drwxr-x--x system   system            2012-08-10 17:07 com.android.server.vpn
drwxr-x--x app_5    app_5             2012-08-10 17:07 com.android.music
drwxr-x--x app_6    app_6             2012-08-10 17:07 com.android.providers.app
lications
drwxr-x--x app_7    app_7             2012-08-10 17:07 com.android.wallpaper.liv
epicker
drwxr-x--x app_8    app_8             2012-08-10 17:07 com.android.fallback
drwxr-x--x app_9    app_9             2012-08-10 17:07 com.svox.pico
drwxr-x--x app_10   app_10            2012-08-10 17:07 com.android.inputmethod.l
atin
drwxr-x--x app_11   app_11            2012-08-10 17:07 android.tts
drwxr-x--x app_12   app_12            2012-08-10 17:07 com.android.soundrecorder

drwxr-x--x app_6    app_6             2012-08-10 17:07 com.android.inputmethod.p
inyin
drwxr-x--x app_0    app_0             2012-08-10 17:07 com.android.providers.dow
nloads.ui
drwxr-x--x app_0    app_0             2012-08-10 17:07 com.android.gallery
drwxr-x--x app_15   app_15            2012-08-10 17:08 com.android.mms
drwxr-x--x app_34   app_34            2012-09-07 15:55 com.hawkagentmain
drwxr-x--x app_35   app_35            2012-09-07 15:55 com.SampleDumpsys.Activit
y
drwxr-x--x app_30   app_30            2012-09-07 15:55 com.android.gesture.build
er
drwxr-x--x app_31   app_31            2012-09-07 15:55 com.example.android.softk
eyboard
drwxr-x--x app_32   app_32            2012-09-07 15:55 com.example.android.livec
ubes
drwxr-x--x app_33   app_33            2012-09-07 15:55 com.example.android.apis
drwxr-x--x app_6    app_6             2012-09-06 20:47 com.android.contacts
drwxr-x--x app_2    app_2             2012-09-06 20:47 com.android.quicksearchbo
x
drwxr-x--x radio    radio             2012-09-06 20:47 com.android.phone

有人能说出这些输出告诉了什么吗? 我将非常感谢你。

3 个答案:

答案 0 :(得分:1)

ls -s /data/data显示/ data / data目录中的目录和文件,其中包含所有者名称(例如,app_30),组名(app_30,所有者名称和组名相同)以及分配给文件夹的权限(drwxr-x - X)。该目录包含已安装的Android应用程序的私有数据。

/proc/<proc_id>/fd显示进程的已打开描述符,其中PID等于proc_id。

答案 1 :(得分:1)

“ls”表示“列出活动目录中的文件 “-l”表示“向我显示每个文件的更多详细信息(权限,所有者,组,创建日期,文件名称) 将“/ proc / fd /”或“/ data / data”置于后面意味着:显示此目录的内容而不是活动目录的内容

这样的条目:“com.android.deskclock”表示目录中有一个具有该名称的文件 鉴于此“18 - &gt; / dev / urandom”表示在该目录中有一个名为“18”的链接,该链接显示在文件“/ dev / urandom”

答案 2 :(得分:0)

-s开关打印列出的每个文件的分配大小。

您还可以在线查看手册页:http://man.he.net/