Difference between revisions of "Trillex linux 1"

From Teknologisk videncenter
Jump to: navigation, search
Line 3: Line 3:
 
The command '''find''' find files on the filesystem.  
 
The command '''find''' find files on the filesystem.  
 
[[Category:Linux]][[Category:H2]]
 
[[Category:Linux]][[Category:H2]]
    Example:
+
Example:
    find /            # List all files
+
find /            # List all files
    find /etc        # List all files under the /etc directory
+
find /etc        # List all files under the /etc directory
    find / | wc -l    # List all files, but don't show them on the screen
+
find / | wc -l    # List all files, but don't show them on the screen
                      # The "|" is a pipe which directs output to the
+
                  # The "|" is a pipe which directs output to the
                      # ''wc'' command as input. ''wc'' is ''wordcount''. The toggle
+
                  # ''wc'' command as input. ''wc'' is ''wordcount''. The toggle
                      # "-l" means count lines.
+
                  # "-l" means count lines.
  
 
=== ls Command ===
 
=== ls Command ===
Line 17: Line 17:
 
The '''cat''' command shows the content of a file
 
The '''cat''' command shows the content of a file
  
    cat /etc/passwd
+
cat /etc/passwd
  
 
=== whereis Command ===
 
=== whereis Command ===
 
Shows the position of certain files and programs.
 
Shows the position of certain files and programs.
  
    whereis bash      # Outputs where files named '''bash''' are
+
whereis bash      # Outputs where files named '''bash''' are
  
 
== Important Files ==  
 
== Important Files ==  

Revision as of 13:05, 9 February 2009

Commands

find command

The command find find files on the filesystem.

Example:
find /            # List all files
find /etc         # List all files under the /etc directory
find / | wc -l    # List all files, but don't show them on the screen
                  # The "|" is a pipe which directs output to the
                  # wc command as input. wc is wordcount. The toggle
                  # "-l" means count lines.

ls Command

List files just like dir does it in a Windows command prompt

cat Command

The cat command shows the content of a file

cat /etc/passwd

whereis Command

Shows the position of certain files and programs.

whereis bash      # Outputs where files named bash are

Important Files

The /etc Directory

passwd File

The passwd file contains all user names as well as their home directory and the shell they use.