Export terminal commands to file.

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Export terminal commands to file.

Baffometo

Baffometo

You can export the last commands from your terminal by using the command “tail”.

tail -n 1 $file1 >> $file2

-n is the total number of rows you want to copy, the location of bash_history is:

/home/$USER/.bash_history

The end code should like like this:

tail -5 /home$USER/.bash_history >> ~/commands

Share Post

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Related Posts

cyber-security

Google Sheets and Python

Nowadays Google Docs has been integrating a whole bunch of features with its amazing API that you can use from triggering a Python script hosted

Read More »
bitcoin

Bitcoin block 700,000th

Bitcoin (BTC) miners officially produced their 700,000th block on Sept. 11, marking a major milestone for a network whose detractors claim it has died 428

Read More »