Solved

Linux: Change name of the "tail -f /var/log/log.txt" process in PS and TOP

Posted on 2014-03-08
2
388 Views
Last Modified: 2014-03-08
As said above I need the process to be hidden/name-changed for all users. Embedding it into another process like sshd is also acceptable.
0
Comment
Question by:Sanction
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39915325
Why would you want to do that?

Anyway, I think it's not possible using high level languages like bash or ksh.

Maybe Perl's "File::Tail" module could be useful.

Here is the very basic example from CPAN, slightly adjusted:

  use File::Tail;
  $file=File::Tail->new("/var/log/log.txt");
  while (defined($line=$file->read)) {
      print "$line";
  }

and here is the link, containing a more sophisticated example:
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm

You could of course go the very easy way by creating softlinks to "tail" as well as to "/var/log/log.txt":

cd /some/dir
ln -s /usr/bin/tail foo
ln -s /var/log/log.txt bar

Now you can run:

cd /some/dir
./foo -f bar
0
 

Author Comment

by:Sanction
ID: 39915362
Thanks, exactly what I was looking for! And to answer your question I am learning Linux Security using offensive tactics.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question