Find Commands Run on Specific Date


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Find Commands Run on Specific Date
# 1  
Old 03-10-2014
Find Commands Run on Specific Date

Hello All,

I was wondering if anyone knew of a way to find out what commands were run on a specific date.

I'm looking to see if I can find certain commands that were run on 3/4, today is 3/10...?

Any thoughts or ideas would be much appreciated!

Thanks in Advance,
Matt

---------- Post updated at 06:03 PM ---------- Previous update was at 06:02 PM ----------

Sorry!!!

Sorry guys, I'm just realizing the history command has dates with the commands in there... Duhhhh!!!


-Matt
# 2  
Old 03-10-2014
That's definitely a specific feature from the shell. Older shells used to only show the commands that were run by a user.
This User Gave Thanks to verdepollo For This Post:
# 3  
Old 03-10-2014
Exporting this makes the date/time available in the history command
Code:
HISTTIMEFORMAT="%d/%m/%y %T"

Well, not sure how old this is though.
This User Gave Thanks to ahamed101 For This Post:
# 4  
Old 03-11-2014
Hey Guys, thanks for the replies...
Yea I guess its a feature of my Bash Version 4.2.42(1) Shell.

If you look at my .bash_history file you can see every other line has a UNIX timestamp and in between are the actual
commands. So I guess the history command then converts the timestamp to a normal date formatted string and outputs like:
Code:
1. 2014-03-11  10:30  ps -ef | grep foobar

Thanks Again,
Matt
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Want to get list of Linux commands used on specific date through HISTORY command

I want to get list of linux commands used on Jan 01 2014 with the help of HISTORY command or some other linux commands,. Kindly help. (3 Replies)
Discussion started by: karthick nath
3 Replies

2. Shell Programming and Scripting

Find files for a specific date

Hi, I am looking to find files of a specific date. I am on Sun Solaris so newermt doesnot work.. I thought of using mtime but not getting how to use it. Please help me with this.. Regards Abhinav (3 Replies)
Discussion started by: abhi1988sri
3 Replies

3. Shell Programming and Scripting

Script to run commands at a specific time.

Hello All, I have written a script which which is working fine to a certain logic of it. But i want a part of the script to run two commands at 00:10 hrs every day. These two command are 1. rm -rf /path/to/folder 2. mail the content of a file. How do i achieve this. Thanks. ... (4 Replies)
Discussion started by: Siddheshk
4 Replies

4. Shell Programming and Scripting

Find files with specific date

Dear all, kindly i have some files with different dates i need to grep word from these files but i need to search in files with date 2012-12-02 not all files in this directory do u have any command (4 Replies)
Discussion started by: maxim42
4 Replies

5. Shell Programming and Scripting

Find and print specific date with awk

hi all I would like to help me find the problem with this script to find and print to the screen a specific date of a log file that I have on my server, the date it is received as the first argument in the script $ 1 Here I show you a few lines that made ​​the idea of ​​my log file: ****... (4 Replies)
Discussion started by: gilmore666
4 Replies

6. UNIX for Dummies Questions & Answers

How to run multiple piped commands in a find -exec statement?

I can't get this to work. Running a single command works fine: find . -name "*.dat" -exec wc -l '{}' \; gives me the file name and number of lines in each .dat file in the directory. But what if I want to pipe commands, e.g. to grep something and get the number of lines with that pattern... (3 Replies)
Discussion started by: DJR
3 Replies

7. Shell Programming and Scripting

shell script that will run for a specific date

Hi, I have these changes needed to modify a shell script that will run on a specific date of a month, below pseudocode, appreciate any answers..thanks.. if date of the month is 26th then ..event 1 fi if date of the month is 26th and month are MAR,JUN,SEP,DEC then ..event2 ... (7 Replies)
Discussion started by: sonja
7 Replies

8. Shell Programming and Scripting

awk statement to find events from a specific date

I have a script which archives log file events which are 90-days old. Script works fine but I wanted some input on one aspect of this script. My nawk statement, bolded below, that removes events 90-days prior from today, I need it to find anything 90-days or older. The log file date pattern looks... (0 Replies)
Discussion started by: numele
0 Replies

9. Shell Programming and Scripting

find pid of process run in specific location

Hello, I have a process a.out that runs from /a and /b How can I get the pid of the one running from /a ps -C /a/a.out does not work Thanks! (4 Replies)
Discussion started by: JCR
4 Replies

10. AIX

find files with specific date and time

Hi, I wanna to find files with specific date and time. I know this command: ls -ltr /system1/*.505 | grep 'Jan 18 09:00'. I want the 'Jan 18 09:00' not hard coded, I want it coming from the system date and time. And I want the time varies from 09:00-09:05. Is this possible without heavy... (3 Replies)
Discussion started by: itik
3 Replies
Login or Register to Ask a Question