Difference between revisions of "FreeBSD"

From Secure Computing Wiki
Jump to: navigation, search
(Commands)
(Commands)
Line 7: Line 7:
 
|-
 
|-
 
| Find the date of the newest file in a directory.
 
| Find the date of the newest file in a directory.
| find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'
+
| <nowiki>find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'</nowiki>
 
|-
 
|-
 
| md5 all files in <foo> directory and find matches
 
| md5 all files in <foo> directory and find matches
| md5 -r ./<foo> | sort | uniq -c
+
| <nowiki>md5 -r ./<foo> | sort | uniq -c</nowiki>
 
|}
 
|}
  

Revision as of 07:00, 20 March 2008

Commands

This is a table of useful commands gleaned out of mailing lists and personal experience.

Command Description Command
Find the date of the newest file in a directory. find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'
md5 all files in <foo> directory and find matches md5 -r ./<foo> | sort | uniq -c

Management

To enable passive mode for fetch when using pkg_add, sent the environment variable FTP_PASSIVE_MODE to something. If you use csh/tcsh, the following command will work:

# setenv FTP_PASSIVE_MODE 1

Networking

Virtualization