Questions tagged [history]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
38 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
1answer
86 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 ...
9
votes
5answers
1k 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
2answers
68 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
1answer
59 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
0answers
17 views

How to delete history of terminal permanently [duplicate]

I tried history -c but it doesn't work It will only clear the history for the current terminal session and when I open a new terminal history appears again Is there any option that I can try
0
votes
1answer
31 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,...
0
votes
0answers
16 views

How do I disable mouse history scrolling?

How Do you disable the ability to scroll through history using the mouse scroll button. The reason that I need to do it that I am programming and I find my scroll history pasted randomly through my ...
1
vote
1answer
47 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
0answers
42 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
1answer
629 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
1answer
134 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
1answer
56 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
0answers
112 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 ...
0
votes
0answers
23 views

Recalling command history [duplicate]

I know about the history command and Ctrl+R and !, but there is still something I find frustrating when working with bash. Let's say I start typing "ssh username@serv" and then I've just ...
5
votes
2answers
4k 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
1answer
58 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 ...
0
votes
0answers
28 views

gnome terminal history strange behavior

When I press UP several times in gnome terminal after 5-6th history item it'll mix the commands. Example: user@computer:~ $ docker run -d -p 8080:elinks http://localhost:32768 I use the following ...
5
votes
2answers
366 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
0answers
19 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
1answer
62 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
0answers
37 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
1answer
514 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
2answers
143 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
2answers
102 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
0answers
940 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
0answers
25 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
0answers
71 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
0answers
137 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 ...
1
vote
0answers
126 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
2answers
2k 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
2answers
6k 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.
0
votes
1answer
175 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
0answers
150 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
2answers
893 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 ...
11
votes
1answer
1k 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 ...
1
vote
2answers
628 views

bash: error in export command that bash: !st: event not found

When i tried to excute the following export SENTRY_SECRET_KEY="k(#!st-6eb2y74=@^6s7a67fy5a&@p3y=57#aszb@hs)n^vv0#" I get the error "bash: !st: event not found" Please give me solution..
0
votes
1answer
51 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 ...
2
votes
1answer
381 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 ...
1
vote
0answers
52 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 ...
5
votes
1answer
2k 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. ...
1
vote
1answer
162 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 ...
0
votes
2answers
381 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
1k 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 ...
2
votes
1answer
59 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
1k 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 ...
1
vote
2answers
170 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
121 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 ...
10
votes
1answer
1k 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.
2
votes
0answers
477 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 ...