Check These Out
Just want to post a Perl alternative.
Does not count hidden files ('.' ones).
This version also attaches to new processes forked by the parent apache process. That way you can trace all current and *future* apache processes.
There are two ways to use "here documents" with bash to fill stdin:
The following example shows use with the "bc" command.
a) Using a delimiter at the end of data:
$ less-than less-than eeooff bc
> k=1024
> m=k*k
> g=k*m
> g
> eeooff
1073741824
b) using the "inline" verion with three less-than symbols:
$ less-than less-than less-than "k=1024; m=k*k; g=k*m; g" bc
1073741824
One nice advantage of using the triple less-than version is that the command can easily be recalled
from command line history and re-executed.
PS: in this "description", I had to use the name "less-than" to represent the less-than symbol because the commandlinefu input text box seems to eat up the real less-than symbols. Odd.
The tilde address operator is an extension of GNU sed. It won't work with POSIX sed.
Returns the '$1'th Fibonacci number.
Oracle DBA remove some logfiles which are still open by the database and he is complaining the space has not been reclaimed? Use the above command to find out what PID needs to be stopped. Or alternatively recover the file via:
$ cp /proc/pid/fd/filehandle /new/file.txt
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
Notifyme is a program that listen in background for users login, and report on login and logout. Users can be specified from a list or in a ~/notify.rc file. -C options force to display messages on the center of the screen.See man notifyme for more details. Part of notifyme package, tested on Debian.
outputs a history of logins on the server (top 10, when piped to 'head'); optional flags: '-a' put the hostname at the end of the line (good for long hostnames), '-i' post the IP instead of the hostname, '-F' put the full login and logout times, rather than short times.