Archive for the ‘Scripts and Commands’ Category

Bash For Loop Examples

Friday, October 24th, 2008

I’m always forgetting the syntax to make “forloops in Bash.  I know I will have to come back here to find it, so I thought I would write put up this quick example with the hope that it will be useful to others as well.

(more…)

Generate Random Passwords on the Linux Command Line

Monday, September 1st, 2008

Here is a quick one line command to generate a random password from the Linux command line.

# < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8

This will create an 8 character long password.  To make it longer or shorter change c8 to c# (# being whatever number you want).

Another way to go about this is the pwgen command.  Simply install pwgen and execute it and it will give you a bunch of random passwords, simply pick one out of the bunch.

Getting your screen back when it’s hosed

Sunday, August 31st, 2008

Try this:

# cat /bin/cat

Behold! Your terminal looks like garbage. Everything you type looks like you’re looking into the Matrix. What do you do?

You type reset. But wait you say, typing reset is too close to typing reboot or shutdown. Your palms start to sweat—especially if you are doing this on a production machine.

Rest assured: You can do it with the confidence that no machine will be rebooted. Go ahead, do it:

# reset

Now your screen is back to normal. This is much better than closing the window and then logging in again, especially if you just went through five machines to SSH to this machine.

See this and other help tips here.

Finding and locating files with find command

Monday, August 25th, 2008

let us see how to use find command
(a) To gain lots of useful information about users and their files

(b) Monitor and enhance the security of system using find command

(more…)

Pages: 1 2 Next