All Tips


4

Tip #226   Open port

iptables -A INPUT -p tcp -i eth0 --dport X -j ACCEPT Read more »
  • TAGS:

14

Tip #224   Add header/footer to command output

If you want to surround the output of a command by a header or a footer try the following:

Read more »

13

Tip #223   Suspend ssh session

Suppose you have just sshed into a computer and you want to get back to the terminal prompt of the computer you started with. Escape, by default with ssh is "~", so enter "~" followed by "ctl-z" to suspend. You can then use 'fg' to go back to the ssh session. Read more »
  • TAGS:

7

Tip #222   Convert tabs to spaces

Use 'expand' to convert tabs to spaces:

Read more »
  • TAGS:

9

Tip #221   fsck my life

To do a filesystem check on all of your partitions, here's a quick one-liner. It parses out /etc/fstab for the partitions and runs a fsck on them.
Read more »
  • TAGS:

15

Tip #220   Actively Monitor a File

This is a way to monitor "/var/log/messages" or any file for certain changes.
The example below actively monitors "stuff" for the word "now" and as soon as "now" is added to the file, the contents of msg are sent by email

Read more »

10

Tip #219   Record your session

Record eveything printed on your terminal screen with the following command: Read more »
  • TAGS:

8

Tip #218   Edit previous commands with fc

Use the 'fc' command to open your previous command for editing in your default editor. Saving the changes will then run the edited command.

'fc -l' will show a list of previous commands to edit and 'fc ' will open a command from the list for editing. Read more »
  • TAGS:
  • fc