Questions tagged [history]
The history command can be used to manage commands you have previously typed in a shell.
199
questions
0
votes
1
answer
37
views
Is it possible to see what processes did last mounted USB device?
Is it possible to see what last mounted USB device? I am afraid, that last device infected my ubuntu machine and want to find out something about that device.
1
vote
0
answers
244
views
zsh: access history from other zsh sessions, but only when I want to, not by default; e.g. different behavior for "history" command and Ctrl+R
Please bear with me, this is not just another question about basic history control options, and I think it has a solid use case.
use case
I have many instances of zsh running (tmux with tmux continuum ...
0
votes
0
answers
19
views
bash handles comments sometimes as commands in regards to writing to history list, what can I do?
I have now by updating got a new version of bash, instead of v590 now v5.2.15(1) (i681-pc-linux-gnu) in Kubuntu 20.04 and KNOPPIX 9.1.
But in this respect the behavior is the same.
Bash manpage says, ...
0
votes
1
answer
52
views
History file was rewritten
I had more then 5K records in my history file on Ubuntu 22.04. But for 5 last months I used my computer only by ssh and now I found that .bash_history file was rewritten with only ssh sessions. And I ...
-3
votes
1
answer
101
views
No updates since mid-December?
I usually get screen messages at least once a week for available security updates (or other updates) and I apply them immediately. But I haven't seen one since mid-December, which seems odd. Is anyone ...
1
vote
1
answer
84
views
"bash --noprofile --norc" destroys .bash_history
While I have HISTFILESIZE and HISTSIZE greater than 500, the bash history gets destroyed after I entered to a "norc" shell. How can I keep the history data through the various shell types?
...
4
votes
1
answer
3k
views
How to clear password history in Linux?
How do I clean the history of previous used passwords? The history which is used by passwd or whatever else?
I see:
t-account@dbg-host: ~ $ passwd
Changing password for t-account.
Current password:
...
0
votes
0
answers
119
views
nano and vim (search) history remove
How can I delete nano and vim history (typed text, search, etc.)? I don't want to disable it for the future, only erase the current values. THX
0
votes
2
answers
556
views
Ubuntu's history keeps popping up
I've got a problem with my Ubuntu 22.04. I want to clear out the command line history, so I type 'history -c' and everything seems fine, I type 'history' and it's all cleard. Then, I logout and ...
0
votes
2
answers
212
views
Is there a way to retrieve my previous commands on Ubuntu?
I was doing an assignment on Ubuntu that requires screenshots of my commands. But my laptop shut down and the program closed without me taking the screenshots. Is there a way to retrieve my previous ...
-1
votes
1
answer
37
views
Find the version of a program using the hash
how could i verify that the man is up to date for a command with the hash?
md5sum pwd
md5sum $(whereis history | awk '{print $2}'))
man history presents:
"The GNU History Library is Copyright (C) ...
0
votes
2
answers
475
views
show previews command on terminal? [closed]
Like in Windows, where if you press "up_arrow" you can see the last used command and the history of commands used before that (in the current season)
Is there anything like that in ubuntu? I ...
2
votes
0
answers
27
views
When using the history command , is it possible to get more details such as timestamp of each result? [duplicate]
History command options to see more details such as timestamp of each command entered
1
vote
2
answers
69
views
Creating individual bash scripts from Linux History
I want to be able to output my Linux bash history to a file. Then line by line create a new shell script with the content of the of each line.
I have tried this so far from the command line..
for ...
0
votes
0
answers
2k
views
Viewing http requests that happened
Is there a log file where ubuntu stores all the http requests that come in?
I need to view a request that happened yesterday, more specifically the body of that POST request.
And also if nothing is ...
0
votes
0
answers
750
views
How to merge history from multiple terminal session
Is there a way to merge history from multiple terminal sessions in Fish shell?
I tried to use the command history merge but I get the following error"
history: you cannot use any options with ...
1
vote
0
answers
41
views
Reviewing history of inputs and outputs
I closed my previous session on Ubuntu and when I logged back in, I realized I wanted a screenshot of my previous outputs. I used history and that only gave me my last 50 previous inputs. Is there any ...
0
votes
1
answer
184
views
History and autocompletion do not work in SSH PAM session (openssh-server, libpam-ldap and nscd)
I configured a Linux Ubuntu 20.04 LTS VM, to authenticate users in the LDAP base and it worked correctly, however, when trying to repeat commands already executed, as we normally do in Linux, pressing ...
0
votes
1
answer
127
views
Help! My bash script stopped working as intended!
I am trying to get a very basic bash script to work but the output for the history command stopped working properly!!
This is the output
#!/bin/bash -i
history
And that's the code
Any ...
-2
votes
1
answer
114
views
I believe I was hacked over night [closed]
I believe I was hacked last night. I am a little bit new to the Linux world so I don't know if this is normal or not, but there were a lot of random things in my command line history. Here a Google ...
8
votes
5
answers
3k
views
How can I recall a command from history by number without executing it?
How can I grab a command from history by number to my command line without executing it?
This immediately executes command number 555 which I'm not looking for:
$ history 10
$ !555
This opens the ...
0
votes
2
answers
276
views
How to save terminal commands differently?
I am taking some online courses. I want to seperate all commands. That is, I want to save all commands that I execute during classes on a different memory file than my other system commands. This will ...
0
votes
1
answer
113
views
How do I execute command from history without printing it again in the terminal?
$ echo hello; cd ~/Docs
hello
$ !!
echo hello; cd ~/Docs
hello
I want to get hello and execute the change directory after typing !! without re-showing echo hello; cd ~/Docs, again.
Edit:
fc ...
0
votes
1
answer
165
views
ksh history problem
I'm on Xubuntu 20.04.02
This is a question about ksh command history. Something had changed recently and I'm looking for a way to restore the old behavior.
For years and up to about a month or so ago,...
4
votes
1
answer
10k
views
How display over 1000 commands history?
I am working on a project that have reached over more than 3000 commands. However most of the commands of mine is repeated and generated automatically due to my program.
I have try to grep or export ...
0
votes
0
answers
78
views
Find the history of all commands entered in a specific location in terminal
Is there a way that I could find history of all commands (or 100 most recent commands) that were entered in a specific directory?
For example, imagine I am in mona@goku:~/research/code/phosa/external/...
0
votes
2
answers
2k
views
Ubuntu 20.04 zfs grub rollback snapshots
I'm interested in teh ZFS snapshot feature, So I deployed 20.04 VM with ZFS.
I created a snapshot to test how the rollback procedure works.
sudo snapshot -r rpool@SNAP1
When then I created and ...
0
votes
1
answer
152
views
Accessing, from inside a script, the exact command that was issued on terminal to fire the script in question [closed]
Let's say I issue the following command:
./myscript.sh file* test.txt
Now, I wish myscript.sh to be able to create a variable, say howiwasran, such that if it were to echo ${howiwasran}, the output ...
0
votes
1
answer
1k
views
use the terminal without making history
I use a shared Ubuntu computer at the local Makerspace. looking at history I can see some times where I sshd into a remote host... I kinda wish I hadn't done that from here. I am able to run history -...
0
votes
0
answers
1k
views
command history
Which is the most correct answer for this question: Write a one-line command that searches the last 50 commands that have been used for the term "find", and saves the result in history.txt
...
72
votes
7
answers
109k
views
Is there a default clipboard history in Ubuntu? If there is, how can I access it?
Is there a default clipboard history in Ubuntu 20.04 or later? If there is, how can I access it? I know there are lots of available applications for saving clipboard history in the default Ubuntu ...
1
vote
1
answer
346
views
How to show recent programmes?
how to display the recently used programmes (not files, that is implemented)?
I am looking for:
a function / script or so to do the job.
How I would like to have the problem solved is something on ...
6
votes
2
answers
1k
views
reverse-i-search of history not finding expected commands
Today upon bringing up a bash terminal I tried finding a frequently-used command from my bash history via Ctrl-r. To my surprise, it wasn't found. Upon inspecting ~/.bash_history, I saw instances of ...
0
votes
0
answers
185
views
Prevent showing duplicated entries in terminal
Is there any way to prevent showing duplicated entries in terminal?
Every time I go up, I see lots of repeated command until I find the command I want
In windows 10 version 2004 they fix this issue, ...
1
vote
1
answer
340
views
How to clear previous data in terminal? [closed]
I’m sure this question has been asked a million and one times already. I saw a video the other day about accessing all lost passwords and usernames through terminal nnd my question is are you able to ...
0
votes
0
answers
44
views
Write bash history when connection is terminated abnormally [duplicate]
How can I make sure that my bash history gets written to ~/.bash_history when I am disconnected abnormally?
I work on several remote Linux hosts, and my connection is frequently terminated abnormally....
1
vote
1
answer
2k
views
Logging all terminal input/output history
Ubuntu 20.04 on Hyper-V VM
I am trying to do something similar to what is written in this answer. I think this answer logs all the terminal to a certain file. I would like to be able to log all my ...
1
vote
2
answers
601
views
How to obtain a consolidated system wide history irrespective of users or powers? [duplicate]
If I am a normal user and I type
history
I get a set of commands typed by me in the terminal.
Now I make myself the sudo su (su stands for super-user here and not substitute user)
sudo su
I am ...
1
vote
3
answers
694
views
History -a from a bash script
I'm trying to call the following within a bash script:
`history -a current_history`
it is supposed to create the file with the commands executed this session.
Works perfectly fine in a shell ...
2
votes
0
answers
2k
views
Why does Ubuntu 20.04 on ZFS destroy custom datasets at boot-time zpool import of the zpool.cache?
After creating the targets of a personal data lake, and filling them with plenty of terabytes through rsync, I was quite surprised at the next reboot, that Ubuntu's ZFS didn't like the datasets, and ...
1
vote
0
answers
58
views
How to view users' history commands from different ssh clients
As admin, I need to check history commands of users. However, I found that logged from different ssh clients, you can't see all history in the host but only history from same ssh client machine. So is ...
0
votes
0
answers
407
views
How to see history of suspensions?
There are commands to check uptime, history of reboots, but how to check time(s) when system was suspended?
Kubuntu 18.04.4 Desktop.
0
votes
0
answers
393
views
append bash history before command finishes
With the solution in [1] it is possible to write the command to bash_history, after the command has finished, with multiple terminals.
That means, if the command is issued and if something happens ...
3
votes
0
answers
915
views
History timestemp shows wrong dates
when running the commands
HISTTIMEFORMAT="%d/%m/%y %T "
history
the date output are wrong. For example the sudo reboot in line 1407 was done on 31/12/2019. I am not sure about the hours.
How can I ...
8
votes
2
answers
5k
views
How to see time in ~/.bash_history file
I added time to the ~/.bashrc file, so now it shows me time when I execute history command like this:
376 04/10/19 20:39:52 sudo cat ~/.bash_history
377 04/10/19 20:40:04 date
378 07/10/19 ...
1
vote
2
answers
20k
views
clear terminal cache [duplicate]
I need to clear the terminal cache, I have tried with history -c but it clears the cache in that terminal session, but if I open another session and type history it shows all the previous commands.
1
vote
1
answer
1k
views
List unique result only on history command
I ran this command
history | cut -c 8-
It listed all the history commands as expected without line numbers.
I'm wondering if there is a way to list only unique one.
I've tried
history | cut -...
0
votes
0
answers
252
views
Changing ubuntu 18 History size
Im trying to change ( Globally) the
HISTSIZE & HISTFILESIZE
I've tried to add the values into /etc/bash.bashrc
and its not working.
Any suggestions?
1
vote
2
answers
2k
views
Shortcut to open xfce4-terminal and run 'history' command on Xubuntu 16.04.6
I'm trying to set a keyboard shortcut to open xfce4-terminal and run history(command) and keeping terminal open, but so far no avail, I read some tutorials then I tried xfce4-terminal -e "/bin/bash -c ...
13
votes
1
answer
3k
views
multiline command chunks in bash history into multiple lines
In Bash (as well as Bash in WSL), multiline written commands can call-back with up/down arrows correctly also built-in history command report them correctly (until I'm still logged-in in bash).
But ...