?
Solved

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

Posted on 2014-03-08
2
Medium Priority
?
396 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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Utilizing an array to gracefully append to a list of EmailAddresses
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…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 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