System information
An Introduction to Shells in General
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 49
-follow Dereference symbolic links.
-name PATTERN File name (leading directories removed) matches PATTERN.
-print Print (default and assumed).
-type X Filetype matches X (where X is one of: f,d,l,b,c,...)
-perm PERMS Permissions match any of (+NNN); all of (-NNN);
or exactly (NNN)
-mtime TIME Modified time is greater than (+N); less than (-N);
or exactly (N) days
Example:
$ find / -name /etc/passwd
/etc/passwd
5.3.17 grep
Syntax: grep [-ihHnqvs] pattern [files...]
Search for PATTERN in each FILE or standard input.
Options:
-H prefix output lines with filename where match was found
-h suppress the prefixing filename on output
-i ignore case distinctions
-l list names of files that match
-n print line number with output lines
-q be quiet. Returns 0 if result was found, 1 otherwise
-v select non-matching lines
-s suppress file open/read error messages
Example:
$ grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
$ grep ^[rR]oo. /etc/passwd
root:x:0:0:root:/root:/bin/bash
5.3.18 halt
Syntax: halt
Halt the system.
5.3.19 head
Syntax: head [OPTION] [FILE]...
Print first 10 lines of each FILE to standard output. With more than one FILE, precede each with
a header giving the file name. With no FILE, or when FILE is -, read standard input.
Options:
-n NUM Print first NUM lines instead of first 10
Example:
$ head -n 2 /etc/passwd
root:x:0:0:root:/root:/bin/bash