Directory Commands

List Structure (ls)


ls - list. Similar to dir in dos. However ls doesn't do much unless command line switches are used.

  • -a include hidden files
  • -d name of current directory
  • -F end directory names with /
  • -i print the inode number
  • -l (lowercase L) make a long listing
  • -R list subdirectories
  • -t sort by time

CREATED 2012-11-17 18:46:25.0

00-17-D1

UPDATED 2012-11-17 18:46:43.0

dir - List Directory Contents


dir [opetions] [file(s)]

List file information of a directory. The default is the current directory. This is a list of some of the commandline switches. See the Man Page for all options.

-a --all List all files including hidden files (those that begine with a .
-A -almost-all List all files except . and ..
--author Used with long listing (l), prints the author of the file.
-B --ignore-backups Don't list files that end in a tilde (~).
-C List files by column
--color[=auto] Colorize output; always, never or auto
-d --directory List directories instead of files. Does not dereference symlinks
--group-directories-first Group directories before files. Does not work with -sort(none) or -U
-i --inode Print the inode index number of each file.
-l Use long list format
-n --numeric-uid-gid Long list with user and group ids
-o Long list with no group information
-p --indicator-style-slash Append a / at the end of directory names
-r --reverse Reverse the order when sorting
-R recursive List sub directories recursivly
-t Sort by modification time
-help Produce a help screen with all opetions

Exit Status:

  • 0 - All is good.
  • 1 - Problems
  • 2 - Big Problems

CREATED 2012-11-17 18:49:30.0

00-17-D4

UPDATED 2012-11-17 18:51:01.0

locate


locate "[filename]" find "[filename]"""

To finde a particular file on the system use...

-b --basename match only the base name of path names
-c --count only print number of found entries
-d --database DBPATH use DBPATH instead of default database (which is /var/lib/mlocate/mlocate.db)
-e --existing only print entries for currently existing files
-L --follow follow trailing symbolic links when checking file existence (default)
-h --help print this help
-i --ignore-case ignore case distinctions when matching patterns
-l --limit -n LIMIT limit output (or counting) to LIMIT entries
-m --mmap ignored, for backward compatibility
-P --nofollow -H don't follow trailing symbolic links when checking file existence
-0 --null separate entries with NUL on output
-S --statistics don't search for entries, print statistics about each used database
-q --quiet report no error messages about reading databases
-r --regexp REGEXP search for basic regexp REGEXP instead of patterns
--regex patterns are extended regexps
-s --stdio ignored, for backward compatibility
-V --version print version information
-w --wholename match whole path name (default)

...or...

CREATED 2012-11-17 22:25:07.0

00-17-D8

UPDATED 2012-11-17 22:25:21.0

Knowledge

dir Man Page
L
I
N
K
S

DBID: db.wam

Page Server: Ruger

©2012 Leistware Data Systems

      Hello anonymous