Sponsored Content
Full Discussion: save history
Top Forums UNIX for Dummies Questions & Answers save history Post 302280008 by chebarbudo on Sunday 25th of January 2009 01:30:52 PM
Old 01-25-2009
bash is my default shell.
In case of crash, I only loose the commands entered during the session that crashed.
It looks like a normal behavior because cat .bash_history contains only commands typed during the previous sessions while history -a contains commands typed during the current session and history -w the concatenation of both.
Example:
Quote:
santiago@aldebaran:~$ ssh supernova
santiago@supernova:~$ cat .bash_history
echo hello world
santiago@supernova:~$ echo -e "this will appear in the history\nbecause this session will logout properly"
this will appear in the history
because this session will logout properly
santiago@supernova:~$ logout
Connection to supernova closed.
santiago@aldebaran:~$ ssh supernova
santiago@supernova:~$ cat .bash_history
echo hello world
cat .bash_history
echo -e "this will appear in the history\nbecause this session will logout properly"
santiago@supernova:~$ echo -e "this won't appear in the history\nbecause this session will crash"
this won't appear in the history
because this session will crash
santiago@supernova:~$ skill -KILL -u santiago
Connection to supernova closed.
santiago@aldebaran:~$ ssh supernova
santiago@supernova:~$ cat .bash_history
echo hello world
cat .bash_history
echo -e "this will appear in the history\nbecause this session will logout properly"
santiago@supernova:~$ echo -e "this will appear in the history\nbecause I'll save it before crash"
this will appear in the history
because I'll save it before crash
santiago@supernova:~$ history -w
santiago@supernova:~$ skill -KILL -u santiago
Connection to supernova closed.
santiago@aldebaran:~$ ssh supernova
santiago@supernova:~$ cat .bash_history
echo hello world
cat .bash_history
echo -e "this will appear in the history\nbecause this session will logout properly"
cat .bash_history
echo -e "this will appear in the history\nbecause I'll save it before crash"
history -w
santiago@supernova:~$
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using history of commands to save typing?

Hi, How do I add a history function to my shell? What I mean is if I have used the command: xemacs file.tex, I'd like to be able to type 'x' then use the arrow keys and go through all the commands I've done starting with an 'x'. Thanks! (3 Replies)
Discussion started by: pmasterkim
3 Replies

2. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

3. UNIX for Dummies Questions & Answers

How to review the history and the commands that has been done in this history?

Hello every body, Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris?? To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time. FYI I used... (5 Replies)
Discussion started by: ahmedamer12
5 Replies

4. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

5. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

6. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

7. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies

8. What is on Your Mind?

The Great History of UNIX (1969-1999) | 30 Years of UNIX History | YouTube Video

I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX. The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Discussion started by: Neo
8 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy