Solved

what does this command mean "history -d $((HISTCMD-1))"

Posted on 2014-09-16
2
315 Views
Last Modified: 2014-09-16
from the command history, I see a command like this:

history -d $((HISTCMD-1))

I don't understand what this command does, could you please help.

thanks.
0
Comment
Question by:Jason Yu
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 40326528
history is a command to manipulate the command line history.

Its "-d" flag is used to delete a command at a specific position (offset).

HISTCMD is a variable containing the future sequence number of the next command.

$(( )) is a shell construct to perform arithmetic operations.

So your command will delete the "current" entry from the shell's history, i. e. the "history -d ..." command itself - for whatever it's worth.
0
 

Author Comment

by:Jason Yu
ID: 40326702
thank you very much, I got it. it's the user wanting to hide his commands.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now