LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Directories (https://www.linuxquestions.org/questions/linux-newbie-8/directories-522243/)

gloomz 01-23-2007 11:55 PM

Directories
 
I know how to navigate directories and everything, but how do you list all the directories.

Like I know /etc/ exists, but if I was new linux user, how would I know it exists.

Is there a command or something that lists all the important directory's?



Thanks for your time :)

pda_h4x0r 01-24-2007 12:18 AM

The command "ls /" will list the contents of the root directory (i.e. the "/"). These will be folders like /bin, /boot, /etc, /usr, /sys, /proc, /root, /home, etc. These are ALL important directories; do not remove ANY of them. Check the man page on the ls command (i.e. run "man ls" in the console) to see what it is capable of doing.

Briefly, its the command you use to list files in a directory. If you want to list all visible directories on the system, then run "ls -R /" (i.e. the -R flag tells ls to show the contents of folders). If you want to see other info (i.e. permissions, ownership, timestamp, size, etc.), then run "ls -l". You can combine options (i.e. "ls -lRa /", which is the same as "ls -l -R -a /", will list every file on the system (the -R flag), will list hidden files (the -a flag), and will list extra file information (the -l flag). Feel free to look through /bin (this is where ls lives), /sbin, /usr/bin, and /usr/sbin to see the commands available to you (the commands in /sbin and /usr/sbin, however, are usually reserved for the root user).

Quakeboy02 01-24-2007 01:09 AM

One thing to add (from experience) is to never ever do something like "rm xxx.*" or "rm *.xxx" while in one of these important directories. Because you can be sure that that one time will be the time that you fumble figure it and what winds up getting executed is "rm xxx. *" which removes everything in the directory.


All times are GMT -5. The time now is 05:15 AM.