Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [history]

The history command can be used to retrieve commands you have previously typed in a shell.

35
votes
2answers
32k views

Bash history not saved after closing terminal

I recently replaced my Ubuntu 14.04 installation with Ubuntu Gnome (which comes with Gnome DE). But I noticed that bash history is not saved once the terminal session is closed. Once I close a ...
0
votes
1answer
37 views

commands history

So, I wanted to see all the history of commands of a certain user, me more specifically, the probem is that I want to do soo in a NFS server that I am connected through ssh, so, everytime I disconect ...
28
votes
2answers
17k views

How do you share history between terminals in zsh?

How can it be achieved so that every command that is entered, is visible in every open terminal's history? When having multiple terminals open, the history isn't shared, i.e. what you entered in one ...
1
vote
1answer
62 views

Bionic Beaver Nautilus list of visited servers

Newly switched from 16.04 LTS to Bionic Beaver. Yet in 16.04 several smb servers were stored to Nautilus server history (or so, sorry don't know the exact terminology). Now after upgrade to B. Beaver ...
1
vote
1answer
3k views

How do I clear Software Center History?

I have old software center history from way back in June and I would like to clear it all but I have tried sudo rm -rf /var/log/apt/history.log /var/log/dpkg.log ut it did not work
2
votes
1answer
45 views

Save all command and all output (using script across terminals)

For a short period of time, I want to save the command history and output of every command I run in any terminal I open. It should all go in the same file. So basically I want to run a command (or ...
0
votes
0answers
39 views

up and down arrow key doesn't working in ubuntu 1804

i've installed ubuntu 1804 i wanna choose the privious command to run of course i can using 'history' command to check but using up/down key to choose is more convinient, like in other OS
1
vote
1answer
964 views

List all manually installed packages similar to history.log file

I searched the whole internet for this but did not find any satisfactory answer for this question. aptitude search ‘~i !~M’ | less does not show the manually installed packages. On my system it ...
3
votes
1answer
141 views

How to clear history in Gedit? (Ubuntu 18.04)

I was just wondering how to clear the recently opened documents history on Gedit? I've looked but can't find anything on it. Thanks in Advanced!
1
vote
0answers
45 views

Terminal/Shell config Question

Ubuntu 18.04.1 LTS TERM=wyse60 SHELL=/bin/bash set -o vi telnet using TinyTerm v4.20.1306 with wyse60 emulation My question is: Is there something I can add to .bash_profile to allow .bash_history ...
100
votes
6answers
46k views

How to avoid duplicate entries in .bash_history

The same command is listed in my history again and again. How can I avoid this? I know it's possible via HISTCONTROL but I haven't found the right way.
133
votes
5answers
74k views

Bash history search, partial + up-arrow

I have searched, but not found anything on this. I am looking for a functionality in bash, using a terminal. Way back when, I had a user on a debian system, and a friend set me up with a convenient ...
22
votes
4answers
75k views

How to find history of shell commands since machine was created?

I created an Ubuntu virtualbox machine a couple weeks ago and have been working on projects off and on in it since then. Now I would like to find the syntax of some commands I typed in the terminal ...
12
votes
5answers
14k views

Select commands from bash history

Pressing the up button is tedious and I might miss the command I was looking for. So when typing history at the terminal gives me all the commands I have entered before, indexed to a number. Is there ...
5
votes
1answer
623 views

Command history seems to be missing the first 75 lines

A couple of years ago, I did the automatic distribution update from 14.04 to 16.04. For the first time in my life, I was able to continue to use the computer after the automatic distribution update. ...
58
votes
5answers
231k views

View history of commands ran in terminal

Is there a way to save all my typed terminal commands and view it like history in a log book?
63
votes
4answers
202k views

How to view the `.bash_history` file via command line?

I want to view the contents of my .bash_history file but don't know how to get there via the command line.
0
votes
0answers
68 views

capture the command that launched the running process in my shell

I try to make the title of my windows in GNU screen automatically equal to the path of the working directory PLUS the process running if there is one (e.g: npm start or vim file.js) for that purpose ...
242
votes
8answers
629k views

How to clear bash history completely?

I want to clear all previous commands from the history of my server. I used history -c and it seems all things are cleared but when I ssh to the server, all the commands are still there. How can I ...
100
votes
4answers
68k views

Bash history handling with multiple terminals

I use mainly Terminator, and it's usually opened with 3 split terminal windows. I also use Gnome terminal for various reasons. I'm wondering how is bash history handled in this case as I sometimes ...
113
votes
6answers
100k views

How do I show apt-get package management history via command line?

Is there a way to show the history of packages that were changed by apt-get via command line?
17
votes
8answers
22k views

How to view history of apt-get install?

How can I view the history of apt-get install commands that I have manually executed? It seems to me that all methods available show everything that has been installed right from the start of the ...
0
votes
2answers
86 views

Cleaning up the whole trace of one's activity on ubuntu

I am working on an ubuntu 16.04 LTS, The computer I am working on is temporarily in my possession, given to me by my employer. So at some point I have to give it back. What exactly should I consider ...
2
votes
1answer
292 views

Ubuntu 16.04 experienced an internal error

My Ubuntu was stuck in a login loophole hence I removed lightdm and installed gdm instead. Somewhere in the instructions someone suggested to add a sleep 1 in a file. After I did so the system has ...
116
votes
4answers
45k views

Is it possible to make writing to .bash_history immediate?

I often open lots and lots of Terminals [Right now I have 7 open on this workspace] and I often search history with grep to find a command I've just written recently, but I don't want to hunt down the ...
2
votes
1answer
42 views

Erase Recent Folder in Nautilus via Terminal Command

Can I empty out Recent folder in Nautilus by typing terminal command, and if yes, do I have to re-log in to my system to see the effect?
0
votes
1answer
46 views

How can I audit commands executed by a user without installing acct

I want to audit commands executed for two accounts on my ubuntu desktop about a year ago. I know of acct [sudo apt-get install acct] where I can run lastcomm, dump-acct, dump-utmp but I want a ...
2
votes
2answers
71 views

Cannot connect to the internet after cleaning history

I was using a friend's laptop with an Ubuntu 16 OS. I was asked to clean the historic files an after browsing a few websites, I used: cat /dev/null > ~/.bash_history command which appear not ...
1
vote
1answer
66 views

Usermod and history output

I used usermod -G without the -a option, now the main user has only 2 groups. I want to restore all the previous groups but the problem is that i need to list all the groups before the changes I am ...
9
votes
1answer
312 views

Is there any way to check history only of current session?

I wanted to know if there is any command or any other way I can check my command history only in the current session.
5
votes
3answers
4k views

History list without timestamp and unique the results

Using bash, I save my history with the timestamp. How do print the history omitting the timestamp? alias h=history alias g=grep -i To find lines that I used for heroku, I type: > h | g heroku ...
0
votes
2answers
208 views

How to store the output of `pwd` along with regular commands in history? [duplicate]

I want to know how I can include the current working directory (output of pwd) to the commands stored in .bash_history file. I want this because sometimes same command is executed from different ...
216
votes
4answers
380k views

How to see time stamps in bash history?

Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also? Bottom-Line: Execution time in the Bash ...
2
votes
0answers
179 views

How to delete bash history for specific date range [duplicate]

I know how to delete the complete history of all the commands I have ran in my bash terminal, however, I don't want to delete all the history. What I want is to delete the history for a specific ...
1
vote
0answers
51 views

Wanted to disable history -c for all users except the one with sudo rights?

I am able to secure .bash_history and .profile files so that user cannot delete or edit those files and cannot change shell as well. I needed this for bastion host for all production instances. I ...
6
votes
5answers
1k views

Searchable Clipboard Manager, like ctrl-r in bash

I am looking for a clipboard manager with search functionality. I love CtrlR in the bash shell and would like to have the same functionality like that in clipboard manager for my desktop. Up to now I ...
4
votes
2answers
1k views

How can I delete the command line history from the dash?

When accessing the command line by pressing Alt+F2 it opens the dash and displays a history of previous commands which have been entered. How can this history be removed? I've tried using Activity ...
12
votes
1answer
352 views

Terminal replacing ! followed by a number with a command

I'm very confused about my ubuntu terminal session, it seems to replace sections in commands that start by ! followed by a number with seemingly random commands. It does that with !87 replacing it ...
1
vote
1answer
3k views

How can I clear screen command history? [duplicate]

I'm using screen command after ssh to a public remote machine with Ubuntu 14.04 so that I could continue my sessions whenever I want. I've found that some admins are tracking my command history and ...
3
votes
1answer
474 views

Pasted commands do not appear in history

when I use copy and paste to run a command, and later I want to run the command again it doesn't appear in history. Sometimes if I paste and then change some of the arguments the command does appear ...
4
votes
3answers
817 views

Up arrow and .bash_history have different commands, so where does the up arrow get its data?

I seem to have discovered that the ~/.bash_history file doesn't contain what is displayed when you use the up arrow. I found this by doing a command like so smbclient -L 10.2.10.240 -umyuser -p"...
5
votes
1answer
3k views

Increase or View all Stored History in Gedit

I would like to be able to see the last ~200 files opened in Gedit. I was able to increase the number it shows to 40 using this command: gconftool-2 --type int --set /apps/gedit-2/preferences/ui/...
229
votes
10answers
18k views

Terminal 'incognito mode'?

I use Terminal a lot, and sometimes I am running commands, which aren't things I don't want others to see, but more commands that if I accidentally arrowed up to and accidentally executed would cause ...
-1
votes
2answers
156 views

Add to History Script not working

I am trying to add lines from a file to my history, but it just adds the program code! What am I doing wrong? #!/bin/bash HISTFILE=~/.bash_history set -o history cat file.txt | while read line do ...
4
votes
1answer
954 views

Can I get the commands from history executed in bash in the last 15 mins?

I want to put in place a cron job that sends me notification about a particular command executed in the last 15 mins. I can get the history along with timestamp using export HISTTIMEFORMAT='%F %T', ...
4
votes
2answers
14k views

How do I check if someone accessed my computer?

I need to check the list of files accessed in my computer (ex: yesterday on particular time). Is it possible? Or I need to check whether anybody accessed my computer (when I left it unlocked) or ...
16
votes
1answer
3k views

How can I view history in terminal for specific date?

How can I view the terminal history for a specific date? For example today is 4-apr and I want to view the history of 31-mar
3
votes
2answers
346 views

!x not found - bash script

I made a simple bash script to run a range of commands in your history, but it's not working. read -p "control + c to cancel" for i in $(seq $1 $2) ...
7
votes
3answers
16k views

Finding an old command in the shell history [duplicate]

How can I find an old command I ran in my terminal? I used an appengine command and wish to just find it in my local command history without researching it online again.
0
votes
0answers
80 views

Terminal can't scroll after overnight idle computing

I'm on unbuntu 16.04, using ubuntu terminal, running zsh with oh-my-zsh. I'm on a ssh session to a remote computer with the same configuration. I launched a big computing and forgot to output the ...