Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I don't think I've ever seen the user panel on the left compressed so much....
If you want to see the actual code that gets run, it's all open-source. Usually Google is a good place to start.
Some commands, like usermod, are parts of a larger group. From looking at the man page (the very last line on the left), on my system usermod is part of "shadow-utils." It's not the actual package name (at least on my system, Arch) but it's a good place to start searching on Google.
The file command will tell you what format these *ahem* files are in. Files that aren't in plain text cannot be viewed using tools meant to display plain text.
The file command itself, as you can see, is in binary format and cannot be viewed as plain text.
bash-4.1$ file $( which file )
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
Whereas startx is a text file and can be viewed:
bash-4.1$ file $( which startx )
/usr/bin/startx: POSIX shell script text executable
To get the source code for the "cp" command, I'd honestly just google "source code for cp command". Source code, as you know, needs to be compiled to a non-human-readable binary format before it can be run. Compilation is not a reversible process. The "cp" in your installation is in that runnable, binary, non-human-readable format.
Is there a way to look into the contents of cmds under /bin (touch, usermod, cp) which we are executing for administration tasks. If yes, how ?
No, there generally is not. Most of the commands are in binary form, however they started out as source. Search for the source. Why do you want to look at a particular command? To understand the command better? To determine if there is a bug in how that command works? Or something else? There are manual pages on many commands. Also be cautious what commands and the situation under which you wish to know about them. There are versions of commands in binary form and sometimes these very same commands are abstracted under something like Busybox, or they are not actual binaries but links to other files, or short scripts.