LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to save command history in Linux (https://www.linuxquestions.org/questions/linux-server-73/how-to-save-command-history-in-linux-815223/)

kkracdba 06-20-2010 12:28 AM

how to save command history in Linux
 
hi all,
i have Q ?
how to save command out put to another file.

Ex: #ps -ef
that particular cmd output i need to save another file.
is it possible ...if possible ..please let me know
And how to save command history in Linux.

unSpawn 06-20-2010 03:40 AM

Quote:

Originally Posted by kkracdba (Post 4009060)
how to save command out put to another file.

Use 'ps -ef > /path/filename': see http://www.gnu.org/software/bash/man...irections.html and http://tldp.org/LDP/abs/html/io-redirection.html


Quote:

Originally Posted by kkracdba (Post 4009060)
And how to save command history in Linux.

In BaSH history is saved automagically to your ~/.bash_history (default location) when your shell session ends so there is nothing you have to do. (Also see 'man bash' for 'shopt -s histappend' and 'history -a'.)


All times are GMT -5. The time now is 03:40 PM.