回忆上次内容

上次讲了 ls 的参数 (arguement) 和选项 (option) 的设置。

现在我们要制作这样一个列表:

  • 对于 /proc 路径进行列表
  • 对子路径递归列表
  • 显示隐藏文件
  • 显示详细信息
  • 其中容量使用人们熟知的单位

大家忘记了吗?!!

没关系,我们可以查手册, 那么做完了之后可以思考,ls 到底在哪?

ls 在哪?

想要知道 ls 在哪就得用新命令 whereis,命令的参数是 ls,综合起来就是:

whereis ls
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUCAII7UGAbBQAEe6AAgOABFBimAGeQYbqRlUQBAEkyaNocpgCADNONrCQKAEiSQdPmMAUAZJhuZCVRAECSDJo2hykAIMN0IyuJAgCSZNC0OUwBABmmG1lJFOgGEHc/RdJuScce9joiyRx6bfMOSfea2f29Fti6rkkBcfcTJF0s6WxJu1o3y/qDFfi4mX12cPYGJ04CiLs/Q9LHJF0u6ZgN1i9T6a81sx9narj0Ojog7n6upE9KOjWb2Bve78/M7DUb3sPK5Y8KiLt/SNIXVq6ShF4U2Glmj/ZSzBh1jAaIu39A0pfGaIo9mikAIC2kdffXSbqnxdqsOZoCB8zspNF262Sj5mcQdz9R0p2Snt9Jz5QxTIGrzeyqYambmzUGINctvsrdXJWo/JtmdmFGGZoC4u6vlPTzgcI+IukPA3NJW48CZQY/MrNvrGe5zVulNSCrnj3uk3STpPvM7OHNk5OK56ZAM0DcvVwm8tjispGIbinf40aEIWY6BVoC8jZJtwVb22FmjwdjCUOB0RRoCcj1kvYEOuHMERCJkGkUaAnIAUnlK97tjiclvYSzxzTDZ9flCrQE5J+SnrakhP1m9orlZRKBAtMo0AQQd3+RpN8FWrrFzN4ZiCMEBSZRoBUgZ0q6O9ARnz8CIhEynQIAMp327LwBCgDIBgyJEqdTAECm056dN0ABANmAIVHidAoAyHTas/MGKAAgGzAkSpxOAQCZTnt23gAFUgLi7i+XVP6vyvGSXibpuA2Y1ZxLLJccPXToZWb7emk2DSDu/kZJZ0g6j5vU9WK/Lev48+JK8HvM7NYpq509IO5+uqQPS7poSqHZe7AC5bane81s7+AVKhJnDYi7f17SRyr0IbUfBQool4/99mu2gLj7TySd1s98qWQNCvxL0hvGhGSWgLi7r2EYLNGvArvM7MExypsdIO5+syQuoR/DPdPuMQokswLE3T8l6Ypp58buIynwG0kXtj6TzAYQd399uYfTSMNhmz4UKN9uXdKylDkBUm5v+uaWYrF2lwq8quUTsGYBiLu/V9INK4zvL5I+LekBSb8ysz+tkEvomhVw9yMllRtjl1d54tgqz45pehaZCyB3LR7jFhlduXvjbjP7aySYmPEVcPdV5nlQ0gvMrPy79mPjAXH3561wD9/bzOyCtavIgmtXwN2vkXRZcOF3mdnXgrErhc0BkEslXRvsmjs4BoXqIczd90sqTz9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWTX7kDuNArMEpEjp7rdLOn+JrDvM7PEa6QGkRr3+c+cMSPmtXn67b3XsNbNLakcEILUK9p0/W0AWZ5H3S/qMpCOfMoarrfKzx6H1AKRvg9dWN2tAFpCcLOlUSS+U9EdJvzezH9YKByDrUrDvdWYPSGv5OYO0Vnja9QGkUn8AqRSw83QAqRwQgFQK2Hk6gFQOCEAqBew8HUAqBwQglQJ2ng4glQMCkEoBO08HkMoBAUilgJ2nA0jlgACkUsDO0wGkckAAUilg5+kAUjkgAKkUsPN0AKkcEIBUCth5OoBUDghAKgXsPB1AKgcEIJUCdp4OIJUDApBKATtPB5DKAQFIpYCdpwNI5YAApFLAztMBpHJAAFIpYOfpAFI5IACpFLDzdACpHBCAVArYeTqAVA4IQCoF7DwdQCoH5O53STp7yTKPmNmLK7cifQIF3P0aSZct2fqgmR3TojxrseiYa7r7LZLeHtjzpWb2cCCOkI4UcPf9kk5ZUtIBMzupRdlzAORaSZcGxHmPmd0UiCOkEwXc/XhJvw2Uc6eZnRuIWzlkDoBcJenKQOc/NbPTAnGEdKKAu18n6eJAOWu5S+f/22cOgJTTbzkNR44bzOx9kUBiplXA3d8k6XvBKtZ2p86n7rfxgJSG3P3XknYFxXyHmd0ajCVsAgXc/URJB4JbPynp5FafL+cCSOSbjsP1/qqkvZIeMLN/BAdBWGMF3L3covYCSZ9YYavrzSzyNmyFJf8bOhdAyle490raMUCFhyRVPYJhwJ6k/K8Cz5J0gqRnDhDmDDMrs29yzAKQxdusD0r6YhOVWLRXBb5jZm9tWdxsAFlA8m1Ju1sKxtrdKPB3Saeb2YMtK5obIM9efLh7TkvRWLsLBfaY2Y2tK5kVIIuzSHkeyS9bC8f6kypwo5ntGaOC2QGygKR8aL9f0tFjiMgeoyrwZTMrnzdHOWYJyAKSYyV9RdJbRlGSTVor8DdJF5nZD1pvdPj6swXkUJPufoWk8jpiTGHZa60KfKtc0Wtm5RF+ox6zB2RxNnn1AhLOJqPaq2qz8hfymyV9veXfOZZVmAKQw84mz5VUrvEpr52Syrdexw38A9Uybfl5XIEnFg94fUzSoVcBY/L/npAKkPi8iESB/ygAIDgBBbZRAECwBwoACB5AgWEKcAYZphtZSRQAkCSDps1hCgDIMN3ISqIAgCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">

我们可以得到 ls 两个硬盘位置:

  /bin/ls
/usr/share/man/man1/ls.1.gz
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUCAII7UGAbBQAEe6AAgOABFBimAGeQYbqRlUQBAEkyaNocpgCADNONrCQKAEiSQdPmMAUAZJhuZCVRAECSDJo2hykAIMN0IyuJAgCSZNC0OUwBABmmG1l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9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWTX7kDuNArMEpEjp7rdLOn+JrDvM7PEa6QGkRr3+c+cMSPmtXn67b3XsNbNLakcEILUK9p0/W0AWZ5H3S/qMpCOfMoarrfKzx6H1AKRvg9dWN2tA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gCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">

为什么 ls 在硬盘里?

  • ls 文件最开始在 /bin 这个位置
  • 当我在命令行敲击之后 ls 回车之后
  • 操作系统要求运行 ls 程序
  • 操作系统分配内存空间给 ls
  • 操作系统把 ls 从硬盘加载到内存中
  • 操作系统分配 cpu 资源去执行程序
  • 最终把 ls 的结果输出到标准输出流(屏幕)上

为什么 ls 命令对应两个位置呢

我们可以对 whereis 发出询问:

whatis whereis
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUCAII7UGAbBQAEe6AAgOABFBimAGeQYbqRlUQBAEkyaNocpgCADNONrCQKAEiSQdPmMAUAZJhuZCVRAECSDJo2hykAIMN0IyuJAgCSZNC0OUwBABmmG1lJFOgGEHc/RdJuScce9joiyRx6bfMOSfea2f29Fti6rkkBcfcTJF0s6WxJu1o3y/qDFfi4mX12cPYGJ04CiLs/Q9LHJF0u6ZgN1i9T6a81sx9narj0Ojog7n6upE9KOjWb2Bve78/M7DUb3sPK5Y8KiLt/SNIXVq6ShF4U2Glmj/ZSzBh1jAaIu39A0pfGaIo9mikAIC2kdffXSbqnxdqsOZoCB8zspNF262Sj5mcQdz9R0p2Snt9Jz5QxTIGrzeyqYambmzUGINctvsrdXJWo/JtmdmFGGZoC4u6vlPTzgcI+IukPA3NJW48CZQY/MrNvrGe5zVulNSCrnj3uk3STpPvM7OHNk5OK56ZAM0DcvVwm8tjispGIbinf40aEIWY6BVoC8jZJtwVb22FmjwdjCUOB0RRoCcj1kvYEOuHMERCJkGkUaAnIAUnlK97tjiclvYSzxzTDZ9flCrQE5J+SnrakhP1m9orlZRKBAtMo0AQQd3+RpN8FWrrFzN4ZiCMEBSZRoBUgZ0q6O9ARnz8CIhEynQIAMp327LwBCgDIBgyJEqdTAECm056dN0ABANmAIVHidAoAyHTas/MGKAAgGzAkSpxOAQCZTnt23gAFUgLi7i+XVP6vyvGSXibpuA2Y1ZxLLJccPXToZWb7emk2DSDu/kZJZ0g6j5vU9WK/Lev48+JK8HvM7NYpq509IO5+uqQPS7poSqHZe7AC5bane81s7+AVKhJnDYi7f17SRyr0IbUfBQool4/99mu2gLj7TySd1s98qWQNCvxL0hvGhGSWgLi7r2EYLNGvArvM7MExypsdIO5+syQuoR/DPdPuMQokswLE3T8l6Ypp58buIynwG0kXtj6TzAYQd399uYfTSMNhmz4UKN9uXdKylDkBUm5v+uaWYrF2lwq8quUTsGYBiLu/V9INK4zvL5I+LekBSb8ysz+tkEvomhVw9yMllRtjl1d54tgqz45pehaZCyB3LR7jFhlduXvjbjP7aySYmPEVcPdV5nlQ0gvMrPy79mPjAXH3561wD9/bzOyCtavIgmtXwN2vkXRZcOF3mdnXgrErhc0BkEslXRvsmjs4BoXqIczd90sqTz9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWTX7kDuNArMEpEjp7rdLOn+JrDvM7PEa6QGkRr3+c+cMSPmtXn67b3XsNbNLakcEILUK9p0/W0AWZ5H3S/qMpCOfMoarrfKzx6H1AKRvg9dWN2tAFpCcLOlUSS+U9EdJvzezH9YKByDrUrDvdWYPSGv5OYO0Vnja9QGkUn8AqRSw83QAqRwQgFQK2Hk6gFQOCEAqBew8HUAqBwQglQJ2ng4glQMCkEoBO08HkMoBAUilgJ2nA0jlgACkUsDO0wGkckAAUilg5+kAUjkgAKkUsPN0AKkcEIBUCth5OoBUDghAKgXsPB1AKgcEIJUCdp4OIJUDApBKATtPB5DKAQFIpYCdpwNI5YAApFLAztMBpHJAAFIpYOfpAFI5IACpFLDzdACpHBCAVArYeTqAVA4IQCoF7DwdQCoH5O53STp7yTKPmNmLK7cifQIF3P0aSZct2fqgmR3TojxrseiYa7r7LZLeHtjzpWb2cCCOkI4UcPf9kk5ZUtIBMzupRdlzAORaSZcGxHmPmd0UiCOkEwXc/XhJvw2Uc6eZnRuIWzlkDoBcJenKQOc/NbPTAnGEdKKAu18n6eJAOWu5S+f/22cOgJTTbzkNR44bzOx9kUBiplXA3d8k6XvBKtZ2p86n7rfxgJSG3P3XknYFxXyHmd0ajCVsAgXc/URJB4JbPynp5FafL+cCSOSbjsP1/qqkvZIeMLN/BAdBWGMF3L3covYCSZ9YYavrzSzyNmyFJf8bOhdAyle490raMUCFhyRVPYJhwJ6k/K8Cz5J0gqRnDhDmDDMrs29yzAKQxdusD0r6YhOVWLRXBb5jZm9tWdxsAFlA8m1Ju1sKxtrdKPB3Saeb2YMtK5obIM9efLh7TkvRWLsLBfaY2Y2tK5kVIIuzSHkeyS9bC8f6kypwo5ntGaOC2QGygKR8aL9f0tFjiMgeoyrwZTMrnzdHOWYJyAKSYyV9RdJbRlGSTVor8DdJF5nZD1pvdPj6swXkUJPufoWk8jpiTGHZa60KfKtc0Wtm5RF+ox6zB2RxNnn1AhLOJqPaq2qz8hfymyV9veXfOZZVmAKQw84mz5VUrvEpr52Syrdexw38A9Uybfl5XIEnFg94fUzSoVcBY/L/npAKkPi8iESB/ygAIDgBBbZRAECwBwoACB5AgWEKcAYZphtZSRQAkCSDps1hCgDIMN3ISqIAgCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">

whereis 可以帮我们定位命令的位置

但是 whereis 描述太简单了,我们可以查询 whereis 的手册 man:

man whereis
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUC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jFhlduXvjbjP7aySYmPEVcPdV5nlQ0gvMrPy79mPjAXH3561wD9/bzOyCtavIgmtXwN2vkXRZcOF3mdnXgrErhc0BkEslXRvsmjs4BoXqIczd90sqTz9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWT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rvEpr52Syrdexw38A9Uybfl5XIEnFg94fUzSoVcBY/L/npAKkPi8iESB/ygAIDgBBbZRAECwBwoACB5AgWEKcAYZphtZSRQAkCSDps1hCgDIMN3ISqIAgCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">

我们可以查询到 whereis 的具体内容:

试试选项的功能

whereis -b ls
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUCAII7UGAbBQAEe6AAgOABFBimAGeQYbqRlUQBAEkyaNocpgCADNONrCQKAEiSQdPmMAUAZJhuZCVRAECSDJo2hykAIMN0IyuJAgCSZNC0OUwBABmmG1lJFOgGEHc/RdJuScce9joiyRx6bfMOSfea2f29Fti6rkkBcfcTJF0s6WxJu1o3y/qDFfi4mX12cPYGJ04CiLs/Q9LHJF0u6ZgN1i9T6a81sx9narj0Ojog7n6upE9KOjWb2Bve78/M7DUb3sPK5Y8KiLt/SNIXVq6ShF4U2Glmj/ZSzBh1jAaIu39A0pfGaIo9mikAIC2kdffXSbqnxdqsOZoCB8zspNF262Sj5mcQdz9R0p2Snt9Jz5QxTIGrzeyqYambmzUGINctvsrdXJWo/JtmdmFGGZoC4u6vlPTzgcI+IukPA3NJW48CZQY/MrNvrGe5zVulNSCrnj3uk3STpPvM7OHNk5OK56ZAM0DcvVwm8tjispGIbinf40aEIWY6BVoC8jZJtwVb22FmjwdjCUOB0RRoCcj1kvYEOuHMERCJkGkUaAnIAUnlK97tjiclvYSzxzTDZ9flCrQE5J+SnrakhP1m9orlZRKBAtMo0AQQd3+RpN8FWrrFzN4ZiCMEBSZRoBUgZ0q6O9ARnz8CIhEynQIAMp327LwBCgDIBgyJEqdTAECm056dN0ABANmAIVHidAoAyHTas/MGKAAgGzAkSpxOAQCZTnt23gAFUgLi7i+XVP6vyvGSXibpuA2Y1ZxLLJccPXToZWb7emk2DSDu/kZJZ0g6j5vU9WK/Lev48+JK8HvM7NYpq509IO5+uqQPS7poSqHZe7AC5bane81s7+AVKhJnDYi7f17SRyr0IbUfBQool4/99mu2gLj7TySd1s98qWQNCvxL0hvGhGSWgLi7r2EYLNGvArvM7MExypsdIO5+syQuoR/DPdPuMQokswLE3T8l6Ypp58buIynwG0kXtj6TzAYQd399uYfTSMNhmz4UKN9uXdKylDkBUm5v+uaWYrF2lwq8quUTsGYBiLu/V9INK4zvL5I+LekBSb8ysz+tkEvomhVw9yMllRtjl1d54tgqz45pehaZCyB3LR7jFhlduXvjbjP7aySYmPEVcPdV5nlQ0gvMrPy79mPjAXH3561wD9/bzOyCtavIgmtXwN2vkXRZcOF3mdnXgrErhc0BkEslXRvsmjs4BoXqIczd90sqTz9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWTX7kDuNArMEpEjp7rdLOn+JrDvM7PEa6QGkRr3+c+cMSPmtXn67b3XsNbNLakcEILUK9p0/W0AWZ5H3S/qMpCOfMoarrfKzx6H1AKRvg9dWN2tAFpCcLOlUSS+U9EdJvzezH9YKByDrUrDvdWYPSGv5OYO0Vnja9QGkUn8AqRSw83QAqRwQgFQK2Hk6gFQOCEAqBew8HUAqBwQglQJ2ng4glQMCkEoBO08HkMoBAUilgJ2nA0jlgACkUsDO0wGkckAAUilg5+kAUjkgAKkUsPN0AKkcEIBUCth5OoBUDghAKgXsPB1AKgcEIJUCdp4OIJUDApBKATtPB5DKAQFIpYCdpwNI5YAApFLAztMBpHJAAFIpYOfpAFI5IACpFLDzdACpHBCAVArYeTqAVA4IQCoF7DwdQCoH5O53STp7yTKPmNmLK7cifQIF3P0aSZct2fqgmR3TojxrseiYa7r7LZLeHtjzpWb2cCCOkI4UcPf9kk5ZUtIBMzupRdlzAORaSZcGxHmPmd0UiCOkEwXc/XhJvw2Uc6eZnRuIWzlkDoBcJenKQOc/NbPTAnGEdKKAu18n6eJAOWu5S+f/22cOgJTTbzkNR44bzOx9kUBiplXA3d8k6XvBKtZ2p86n7rfxgJSG3P3XknYFxXyHmd0ajCVsAgXc/URJB4JbPynp5FafL+cCSOSbjsP1/qqkvZIeMLN/BAdBWGMF3L3covYCSZ9YYavrzSzyNmyFJf8bOhdAyle490raMUCFhyRVPYJhwJ6k/K8Cz5J0gqRnDhDmDDMrs29yzAKQxdusD0r6YhOVWLRXBb5jZm9tWdxsAFlA8m1Ju1sKxtrdKPB3Saeb2YMtK5obIM9efLh7TkvRWLsLBfaY2Y2tK5kVIIuzSHkeyS9bC8f6kypwo5ntGaOC2QGygKR8aL9f0tFjiMgeoyrwZTMrnzdHOWYJyAKSYyV9RdJbRlGSTVor8DdJF5nZD1pvdPj6swXkUJPufoWk8jpiTGHZa60KfKtc0Wtm5RF+ox6zB2RxNnn1AhLOJqPaq2qz8hfymyV9veXfOZZVmAKQw84mz5VUrvEpr52Syrdexw38A9Uybfl5XIEnFg94fUzSoVcBY/L/npAKkPi8iESB/ygAIDgBBbZRAECwBwoACB5AgWEKcAYZphtZSRQAkCSDps1hCgDIMN3ISqIAgCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">
  • b 的意思是 binary 二进制
  • 查找 whereis 二进制
  • 二进制文件在/bin 里
whereis -m
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAALCElEQVR4Xu2dXchlZRXH/+uiyDAV7SIm+pg+MBvxow9IpNTArFCbQrS6iKhJ+zCwspu8UKOb6MML+8BREypTCCslI6xw1IiCbMopSTCxEiSKagy8qIsVD52hSXrfs85+zrP3c/b6bTjMxbvW86z1X//fu8857569TRwogAJbKmBogwIosLUCAII7UGAbBQAEe6AAgOABFBimAGeQYbqRlUQBAEkyaNocpgCADNONrCQKAEiSQdPmMAUAZJhuZCVRAECSD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nXgrErhc0BkEslXRvsmjs4BoXqIczd90sqTz9edjT7xTcHQD4n6aPLFJTEHVQCIvUU4u7nS7o9UNMvzKxcnb32Yw6AlLvBvzugzDlmVt7bcmyIAu7+dEnlyt6jlpT8qJntbNHWHAApD7svl7BvdzxhZke3EJA12yrg7t+XdM5U850DIOUGdeVGddsd+8zsrLajZPUWCrh7eezblcvWNrMmXm6yqLuPdmdFdweQZe7Z4J8DSOWDIQFkg90fKB1AACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whAAIged0f6BxAACRgk7whcwXkKEkHA2M9z8y+G4jbMsTd75Z05pI19pnZWTX7kDuNArMEpEjp7rdLOn+JrDvM7PEa6QGkRr3+c+cMSPmtXn67b3XsNbNLakcEILUK9p0/W0AWZ5H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EKcAYZphtZSRQAkCSDps1hCgDIMN3ISqIAgCQZNG0OUwBAhulGVhIFACTJoGlzmAIAMkw3spIoACBJBk2bwxQAkGG6kZVEAQBJMmjaHKbAvwGyE7Iy90AbtwAAAABJRU5ErkJggg==" class="icon-copy" title="copy">
  • m 的意思是 manual 文档
  • 查找 whereis 的文档
  • 文档在/usr/share/man 里面

总结来说:whereis -b ls 是二进制命令,whereis -m 另一个是帮助手册。

那 ls 的源文件在哪呢?这有点复杂...

得到 ls 源文件

  • dpkg -S /bin/ls

    • dpkg 是 Debian Package 是 Debian 的包管理命令
    • -S 是在已经安装的包里面查找 search
    • /bin/ls 是具体文件的位置
    • 得到结果是 coreutils(核心应用)
  • 设置源

    1. sudo vi /etc/apt/sources.txt
    2. 打开源的配置文件
    3. sudo 是使用管理员权限
      • vi 是文本编辑器
      • /etc/apt/sources.txt 是源的配置文件
    4. 直接输入 G(直接到最后一行 Ground)
      • 注意这个时候左下角是空白状态
    5. 直接输入 o(在当前行后面添加一行)
      • 注意左下角变成了 Insert(插入状态)
    6. 将下面粘贴到最后一行
    7. 摁下 esc
      • 注意左下角不再是 Insert(插入状态), 而是退回到了空白
    8. 依次摁下
      • :
      • w
      • q
      • 回车
      • 保存并退出 vi
  • 用 apt 下载源代码

    1. apt 是高级包管理的命令
    2. 运行 sudo apt update(更新源)
    3. sudo apt source coreutils(获得源代码)
    4. 在当前文件夹下找到 coreutilsXXX 文件夹
    5. 进入 src 源文件文件夹 (source)
    6. ls ls.*
    7. 找到了 ls.c 文件 (ls 的 c 语言源文件)

思考

我们真的可以获得 ls 源代码,这太棒了! 可是如果有多个版本的命令比如:

  • java8
  • java13

那我到底用的是那个版本的 java 呢?我们下次再说。

oeasy教您玩转linux010107那啥在哪 whereis的更多相关文章

  1. oeasy教您玩转vim - 56 - # 字符可视化模式

    ​ 可视化编辑 回忆上节课内容 我们学习了关于模式匹配中使用参数 单个参数 :%s/<h2>\(.*\)</h2>/ - \1/g 多个参数 :%s/<img src=\ ...

  2. oeasy教您玩转vim - 57 - # 行可视化

    ​ 可视化编辑 回忆上节课内容 上次我们了解到可视模式 其实可视化对应三种子模式 字符可视模式 v 行可视模式 大写V 块可视模式ctrl+v 我们先来了解字符可视化模式 快捷键 v 可配合各种mot ...

  3. oeasy教您玩转linux010203显示logo

    我们来回顾一下 上一部分我们都讲了什么?

  4. oeasy 教您玩转linux010101查看内核uname

    linux([?l?n?ks]) 是什么????? 咱们这次讲点什么呢?这次咱们讲讲这个 linux([?l?n?ks]),什么是 linux([?l?n?ks])呢?这linux([?l?n?ks] ...

  5. oeasy教您玩转linux010202软件包管理apt

    顾一下 上一部分我们都讲了什么?

  6. oeasy教您玩转linux010201持续输出yes

    我们来回顾一下 上一部分我们都讲了什么?

  7. oeasy教您玩转linux010108到底哪个which

    到底哪个which 回忆上次内容 我们上次讲了查找命令位置whereis 我想找到whereis的位置怎么办?

  8. oeasy教您玩转vim - 53 - # 批量替换

    查找细节 回忆上节课内容 我们温习了关于搜索的相关内容 /正向,?反向 n保持方向,N改变方向 可以设置 是否忽略大写小写 是否从头开始查找 是否高亮显示 还有一些正则表达式的使用方法 行头行尾 ^$ ...

  9. oeasy教您玩转python - 006 - # hello world

    ​ Hello World! 回忆上次内容 python3 的程序是一个 5.3M 的可执行文件 python3 里面全都是 cpu 指令 可以执行的那种指令 我们可以把指令对应的汇编找到 objdu ...

随机推荐

  1. Python多线程-ThreadLocal

    参考:https://www.liaoxuefeng.com/wiki/1016959663602400/1017630786314240#0 ThreadLocal ThreadLocal变量虽然是 ...

  2. SAFe必备——提高团队敏捷性

    规模化敏捷之于项目群,就像Scrum之于敏捷团队.为了创建高质量业务解决方案,企业需要提高自身能力,提升团队和技术敏捷性,实现真正的规模化敏捷. 敏捷发布火车 实现团队和技术敏捷性,首先需要敏捷团队围 ...

  3. Docker 启动 Nginx

    Docker 启动 Nginx 拉取镜像 docker pull nginx:1.17.9 启动步骤 # 创建 nginx 目录 mkdir -p /usr/local/nginx && ...

  4. 图解比原链Tensority算法:如何让POW做到人工智能友好

    共识算法说起 区块链系统首先是分布式系统,而一致性是分布式系统的基础问题,要保证系统满足不同程度的一致性,则就要用到共识算法. 现在主流的算法有POW.POS.DPOS等等,比特币采用的POW共识算法 ...

  5. 解决Android v4、v7包导入标红问题import android.support.v4.app.ActivityCompat;import android.support.v7.app

    如果有如下错误:import android.support.v4.app.ActivityCompat;import android.support.v7.app.AppCompatActivity ...

  6. java System类、Math类、Arrays类

    一 System类 1.概念 在API中System类介绍的比较简单,我们给出定义,System中代表程序所在系统,提供了对应 的一些系统属性信息,和系统操作. System类不能手动创建对象,因为构 ...

  7. C++/C socket编程

    目录 socket()函数 何为socket Internet套接字 流格式套接字SOCK_STREAM 数据报格式套接字SOCK_DGRAM TCP/IP协议族 创建套接字 加载套接字库 Windo ...

  8. C#算法设计排序篇之04-选择排序(附带动画演示程序)

    选择排序(Selection Sort) 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/681 访问. 选择排序是一种简 ...

  9. Flutter build apk 如何访问网络

    将下列配置放到路径:your_project\android\app\src下的 main 文件夹下的 AndroidManifest.xml 和 profile 文件夹下的 AndroidManif ...

  10. JavaScript apply使用

    call 和 apply 作用: 都是为了改变某个函数运行的context上下文而存在的,为了改变函数体内部 this的指向 JavaScript函数存在定义时上下文和运行时上下文, 上下文(cont ...