DebianThis forum is for the discussion of Debian Linux.
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 am not sure if this is the right place to ask this, but since I have Debian installed I'll ask.
How, or where, do I find a listing of what Directories and Files are used in Debian? Surely there is a default listing somewhere.
What executable files are in Debian? For example, the file "cat" does not appear to exist or I do not know what Directory, or how to get to it, to find it in. Anyway, I can not execute the "cat" command either as root or as a user.
I am, what was called, windows-centric. I am used to being able to do a dir or tree command to find a complete listing of what files are in what directory. Linux does have the "ls" command, but that is only good for the directory you are in. And, since I do not know what directories are available I can not change directories and use the "ls" command. Even then, doing them one at a time, it would be awkward and time consuming.
In Linux, so far, I feel like I am walking around blind. Unable to see what the "Path" is or what files are located where.
ls can list recursively as well by the -R option to it. Example:
One can also use the find command. It can be combined with e.g. grep or find's own -regex option to filter out all unwanted data. Example:
find | grep -i mp3
You can also use the locate command to find files, but the locate command needs it's database being up to date. That is usually updated from a cronjob sometime in the early morning hours but if one doesn't have the computer turned on 24/7, there is a risk that it hasn't run in a long time. To update the locate's database manually, execute updatedb as root. Example of using the locate command:
To see what your PATH environment variable contains, execute
The directories listed there are the ones that typically contain the executables (or symlinks to them or wrapper scripts to them).
In general, you'll want to "cd" to different places. To get to the root of all of your files, type "cd /" - that's a FORWARD slash, not a backslash. Then you can ls, and see all your root directories. CD around and look around. As a general rule, debian's regular executable files are located in /usr/bin (for example, mozilla), the ones that are very basic / might be needed when emergency booting / etc. (for example, cat and ls) are located in /bin, and system tools (that can usually only be used by root) are in /sbin.
After you've apt-get install 'ed a package and you want to know what files are sitting on your system from that package, try a "dpkg -L packagename". For example, "dpkg -L coreutils" will show you all the files that the package "coreutils" is using on your system - which is the package that contains the program "cat". If you don't have it, remember you'll want to "apt-get install coreutils" as root, first.
Anyways, all this is to satisfy your curiousity, but if you're still new to linux, you shouldn't need to worry about any of this, and you can just apt-get install things and happily type in the command name at the commandline without worrying about where its files are located / etc.
In a way you are correct in your statement "Anyways, all this is to satisfy your curiousity, but if you're still new to linux, you shouldn't need to worry about any of this..."
But, when a "standard" command is used and it does not execute then I need to be able to find if it even exists and where it is located to be able to use it. You say "... which is the package that contains the program "cat". If you don't have it, remember you'll want to "apt-get install coreutils" as root, first." The executable "cat" does not work on the Debian distribution I installed. So, I want to first find out where it is supposed to be located and what the path should be for it to work correctly. That way I will learn some of the internal operations of the Debian distro.
I am not sure about this "cat" program anyway. I have used vi and am fairly comfortable with it. I still have my "cheat sheets" from school somewhere and the Unix System V Bible is still applicable.
I am not ready to add any additional ports, programs, or utilities until I have familiarized myself with those already provided in the Debian basic install. The structure of directories and files have a big influence in my ability to learn and be able to use the system effectively.
I first want a solid foundation of the basics before I start getting into the use of advanced commands and GUIs.
Doing a CD look around in individual directories is what I was trying to do and found that to be a very time consuming and sometimes confusing activity.
Where do I find the Basic Default Directories and File listings for this Debian Distribution? There has to be one, if just for a quick reference for the developers to ensure some form of continuity.
Where do I get access to the PATH environment for making corrections?
It is my curiosity which drives me to understand something before I try to use it. I still believe in using the Command Line in Microsoft and have found that even some of the old, but useful, DOS commands will still work even in Win 2k and XP. The hard part is keeping track of them as the upgrades progress.
Oh, and the mc program I mentioned in my earlier post is GNU Midnight Commander, a friendly file manager that lets you stay close to the command line. I've personally found it very useful when exploring a new system and its file hierarchy. Here's a picture that should give you an idea of what mc looks like: http://www.ibiblio.org/mc/images/mc-panelize-info.png
But if you want to use only the bash commands, then have it your way.
MC is pretty cool. But there's always combos. If you like your fighting games, you know combos dish out extra damage- and in linux, combining commands with pipes, filters, other commands, etc can yield good results if for example you are trying to find a particular text file.