Jan
27
Some Simple Little Linux Commands You Can Never Remember When You Need Them
Filed Under Computers & Tech, System Administration on January 27, 2006 at 2:37 pm
I’m sure you know the feeling, you’re on a server, some form of excrement has just hit some kind of spinning thing and know that netstat will do what you want if only you could remember the bloody set of options you needed. Well, from now on I’m adding all those commands to this Blog entry so next time that happens I’ll know here to look!
This page will be continually updated but I’m gonna start with a few of those commands I’ve needed in the last few days that are currently stuck to my display in little yellow PostIt Notes.
What Processes are Listening on What TCP Ports
When you need to easily see what a server is serving in a hurry use:
netstat -lntp
Creating and Extracting tar.gz Files Just Using tar
I used to always create and extract tar.gz files by using both tar and gzip and sticking them together with a pipe (I’m sure that nasty Sun E450 was in some way to blame for me getting into that habit). This command was always long and I never remembered the syntax. So here’s the easy way to create a tar.gz archive:
tar -pczf name_of_your_archive.tar.gz /path/to/directory
(You should leave out the p if you don’t want to preserve the file permissions). And here is how to extract one:
tar -xzf file.tar.gz