?
Solved

How do I view a user command line history in linux?

Posted on 2011-09-09
7
Medium Priority
?
466 Views
Last Modified: 2012-06-21
Hi,

I am root on a server, but I would like to find out the  history of all the commands typed by a specific user.

also, how do i clear  a specific user command history?
0
Comment
Question by:cismoney
[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
7 Comments
 
LVL 8

Expert Comment

by:pilson66
ID: 36509305
simply enter "history"
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36509306
Depending on the shell of the user examine

.bash_history or .sh_history etc. in the user's $HOME.

Clear this file to clear the history.

wmp
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:cismoney
ID: 36509374
I know the command "history", but I want to see the "history of a specific user.

@woolmilkporc : what is the command to clear this file?
0
 
LVL 8

Expert Comment

by:pilson66
ID: 36509396
see /home/specific_user/.bash_history
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 1000 total points
ID: 36509443
Just

>.bash_history

is sufficient.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 1000 total points
ID: 36509618
To view

less ~user/.bash_history

Open in new window


To clear

rm ~user/.bash_history

Open in new window


or

> ~user/.bash_history

Open in new window

0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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