LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2014, 01:57 AM   #1
nabendu
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Rep: Reputation: Disabled
history command


I am using history -c. It has deketed all command but
I want to delete only last 10 commands from terminal. Please help!!!
 
Old 12-22-2014, 02:31 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read man page of bash

man bash
 
Old 12-22-2014, 02:39 AM   #3
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Hi and welcome to LQ. You'll find loads of answers to your question here. It's always a good idea to do a web search for these kinds of questions. I used the keywords linux history last 10 to find this one.
jdk
 
Old 12-23-2014, 04:21 AM   #4
nabendu
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
Read man page of bash

man bash



checked... but not get solution. Please help to get particular command
 
Old 12-23-2014, 09:02 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by nabendu View Post
checked... but not get solution. Please help to get particular command
Here's one possible solution to your problem:http://goo.gl/FeV3
and here's how you can delete the last 10 of your bash_history (do make backups)
http://stackoverflow.com/questions/1...mands-in-shell
which I found using http://goo.gl/FeV3

Have a good day.
 
Old 12-23-2014, 09:19 AM   #6
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Did you look at the link in post #3?
jdk
 
Old 12-26-2014, 09:26 PM   #7
make install clean
LQ Newbie
 
Registered: Dec 2014
Posts: 11

Rep: Reputation: Disabled
Quote:
Originally Posted by nabendu View Post
I am using history -c. It has deketed all command but
I want to delete only last 10 commands from terminal. Please help!!!
The others have answered your question, so I will not repeat. I have a tip though.

You can make history ignore commands you typed by preceding a space before the command.

Edit /etc/profile and add an ignorespace to the HISTCONTROL line. For example

HISTCONTROL=ignoredups:erasedups:ignorespace
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
history command in hp ux abhijeetdutta Other *NIX 8 05-22-2014 02:10 PM
[SOLVED] timestamp of command history doesn't show time command was executed? UprLftCstr Linux - Newbie 3 04-17-2014 12:31 PM
[SOLVED] Is there any command to delete bash command history? cola Linux - Newbie 4 06-01-2010 07:32 AM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM
History command amer_58 Linux - General 5 06-24-2005 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration