Displaying Masqueraded Connections

I often use Linux’s netstat command to do things like figuring out which ports are listening on a computer and what are the active connections on a computer. It’s very handy for troubleshooting networking problems.

Today I wanted to figure out what sites a certain user on my network was connecting to and how much traffic the user was using. I connected to the router with SSH and ran netstat with no options. I was surprised to see only my SSH connection. Then I remembered that the user in question gets onto the internet with a masqueraded address. Well, duh! Continue reading » Displaying Masqueraded Connections




Linux traceroute vs Windows tracert

Anyone who has used Linux traceroute and Windows tracert knows that the two programs have very different command line options. But did you know that there is a fundamental difference in the way that these two programs work? Continue reading » Linux traceroute vs Windows tracert

How to Sort Files By Modification Time in ls

To sort files by modification time when using ls, use the -t option. For example, to sort in descending order:

[me@mycomputer usr]$ ls -lt
total 224
drwxr-xr-x   88 root root 65536 Sep  1 17:39 lib
drwxr-xr-x   14 root root  4096 Sep  1 16:00 local
drwxr-xr-x    2 root root 12288 Jul 26 04:04 sbin
drwxr-xr-x  174 root root  4096 Jul 25 19:01 share
drwxr-xr-x    2 root root 40960 Jan 25  2006 bin
drwxr-xr-x    7 root root  4096 Jan 16  2006 libexec
drwxr-xr-x    3 root root  4096 Oct 16  2005 java
drwxr-xr-x   61 root root 12288 Mar 13  2005 include
drwxr-xr-x    4 root root  4096 Mar 13  2005 src
lrwxrwxrwx    1 root root    10 Mar 13  2005 tmp -> ../var/tmp
drwxr-xr-x    6 root root  4096 Feb 27  2005 kerberos
drwxr-xr-x    2 root root  4096 Feb 22  2005 etc
drwxr-xr-x    2 root root  4096 Feb 22  2005 games
drwxr-xr-x    7 root root  4096 Feb 21  2005 X11R6

To sort in descending order, add the -r option:

[me@mycomputer usr]$ ls -ltr
total 224
drwxr-xr-x    7 root root  4096 Feb 21  2005 X11R6
drwxr-xr-x    2 root root  4096 Feb 22  2005 games
drwxr-xr-x    2 root root  4096 Feb 22  2005 etc
drwxr-xr-x    6 root root  4096 Feb 27  2005 kerberos
lrwxrwxrwx    1 root root    10 Mar 13  2005 tmp -> ../var/tmp
drwxr-xr-x    4 root root  4096 Mar 13  2005 src
drwxr-xr-x   61 root root 12288 Mar 13  2005 include
drwxr-xr-x    3 root root  4096 Oct 16  2005 java
drwxr-xr-x    7 root root  4096 Jan 16  2006 libexec
drwxr-xr-x    2 root root 40960 Jan 25  2006 bin
drwxr-xr-x  174 root root  4096 Jul 25 19:01 share
drwxr-xr-x    2 root root 12288 Jul 26 04:04 sbin
drwxr-xr-x   14 root root  4096 Sep  1 16:00 local
drwxr-xr-x   88 root root 65536 Sep  1 17:39 lib

How to Add a User to a Group in Linux

Today I had to add an existing user to an existing group in Linux. It’s been so long since the last time I did it that I had actually forgotten how to do it. Well, good ol’ man pages to the rescue. Here’s how to do it:

adduser user group

If you want to verify that it worked, use grep:

grep group /etc/group

In grep’s output, you should see the user’s name. For example:

group:!:50:tom,dick,harry,user

Enjoy!

Page 6 of 7« First...«34567»