Login | Sign up

May 30

Find files with setuid or setgid

You should check to make sure there are no unneeded setuid and setgid files on your computer. They might be a potential security risk.

setuid and setgid permissions are very useful, however, they can be used to attack a system. Only files that absolutely need these ...

May 29

How long did that command take

Bash has a built in command to tell you how long a command took to execute. There is also a gnu version for those not running Bash.

If you want to know how long a command took to execute, you can use the Bash built-in command time. Simply prepend your ...

May 28

Save the output of commands

There are many reasons you may want to save the output of various commands. You may be establishing a baseline, documenting, keeping records, or just manipulating existing files. Learn how to do it and learn about saving errors too.

You can save the output of most Linux commands to files using output redirection. All you need to do it is add a greater ...

May 27

The power of grep

The grep command allows you to search files and filter command output based on your search criteria. This command is such a time saver, it is possibly my favorite Linux-only command.

Intro to grep

The grep command allows you to search the output of a command or files for a given string or ...

May 26

Watching your logs in real time

It can be very useful to see logged messages as they are logged. You can get a better feeling for what event triggered the message. You can easily view appended log messages using a basic Linux command, tail.

Sometimes when setting up new services or when troubleshooting a problem, you want to watch your log files as they grow. You want to ...

May 25

Intro to piping

Piping is one of the many great features of Linux that makes its command line so superior. You can send the output of one command to the input of another.

In the Linux terminal, you can send output from one command to another, instead of displaying it to the screen. This allows programs to ...

May 24

How many lines is this?

Using the wc command to count lines, words, characters and bytes in files and command output.

If you want to know how many lines a certain command outputs or how many lines are in a file, you can use the ...

May 23

Intro to setuid and setgid

setuid and setgid are useful file permissions. Learn what they are, how to add and remove them and check if they were set successfully.

What are setuid and setgid

setuid and setgid are linux file permissions. When a file has one or both of these ...

May 22

Enable syntax highlighting in vi

Vi supports syntax highlighting for many types of files including programming language and configuration files. You can turn it on and off whenever you need it.

Turn on syntax highlighting in vi

  1. Make sure you are in Normal mode. If you are unsure, press Esc.
  2. Type ...
May 21

Require wheel membership to su

Learn how to limit access to su and make it more difficult to guess your root password.

su allows you to switch to another user (typically root). Unfortunately, your users can attempt to guess the root password this way. You ...

May 20

Backup & Restore your Master Boot Record (MBR)

Learn how to backup and restore your hard drives' Master Boot Record (MBR) using Linux.

All hard drives have a Master Boot Record (MBR). This record is used when booting your computer. It also holds information about the hard ...

May 19

Creating tinydns (djbdns) records

Creating DNS records for tinydns is pretty easy using the included scripts. Detailed explanation and examples on using each one. One final example putting everything together.

Tinydns records are created using a text configuration file. It also comes with some helper scripts to make it easier to create some basic ...

May 18

Install tinydns (djbdns) and its requirements

Tinydns (djbdns) is a DNS server designed for security. It has a smaller memory footprint than BIND. Learn how to install it and its prerequisites from source.

In order to install almost any program from source, you will first need to install gcc and make. How you install these will depend ...

May 17

Vi show/hide line numbers

Vi can display line numbers to the left of each line. Learn how to show and hide those numbers.

Show vi line numbers

  1. Make sure you are in Normal mode. If you are unsure, press Esc.
  2. Type the following ...
May 17

Vim basic modes

Vim has 6 basic modes each serving a different purpose with different commands available. Learn the basics and differences of each mode.

Normal/Command

This is the default mode when you start vim. In this mode you can move the cursor around using the arrow ...