LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 02-23-2005, 10:20 AM   #1
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Rep: Reputation: 30
Wink Directory/File Listings


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.

Thanks,
 
Old 02-23-2005, 10:48 AM   #2
dastrike
Member
 
Registered: Apr 2004
Location: Stockholm, Sweden
Distribution: Debian 'sid'
Posts: 250

Rep: Reputation: 30
ls can list recursively as well by the -R option to it. Example:
Code:
ls -R
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:
Code:
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:
Code:
locate readme.txt

To see what your PATH environment variable contains, execute
Code:
echo $PATH
The directories listed there are the ones that typically contain the executables (or symlinks to them or wrapper scripts to them).
 
Old 02-23-2005, 01:43 PM   #3
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
$ su
# apt-get install mc
# exit
$ mc
 
Old 02-23-2005, 01:54 PM   #4
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 15
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.
 
Old 02-23-2005, 03:11 PM   #5
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 235

Original Poster
Rep: Reputation: 30
Cool New means need to know and learn

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.
 
Old 02-23-2005, 03:32 PM   #6
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
man hier
more ~/.bash_profile
more /etc/profile

Or you can use vi instead of more.

I'd suggest you re-install Debian using Debian-Installer release candidate 2 to get a fully working base system with all the necessary goodies:
http://www.debian.org/devel/debian-installer/
 
Old 02-23-2005, 03:44 PM   #7
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
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.
 
Old 02-24-2005, 01:59 AM   #8
f1dave
Member
 
Registered: Jan 2005
Location: Kinross, Western Australia
Distribution: Kubuntu 5.04 (Hoary)
Posts: 114

Rep: Reputation: 15
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.

Of course, combos aren't always easy to learn. :S
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
G++ environment variables, rerouting output, file listings and PIDs Kawahee Programming 7 09-19-2005 01:40 PM
vsftpd on Fedora 4 - empty/incomplete directory listings REdward Linux - Networking 0 08-19-2005 05:56 PM
Stop directory listings in Apache lothario Linux - Software 2 05-23-2004 10:17 AM
Apache directory listings Boffy Linux - Networking 8 04-30-2004 05:47 AM
SLOW everything is SLOW - Even directory listings! astroboy5714 Linux - Networking 1 01-25-2004 09:31 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration