Skip to content

Instantly share code, notes, and snippets.

@nathanathan
Last active December 18, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanathan/5770295 to your computer and use it in GitHub Desktop.
Save nathanathan/5770295 to your computer and use it in GitHub Desktop.
This is a list of random shell commands that solved problems for me.

Show processes and sub-processes in a tree:

pstree

Restart networking stuff in Ubuntu:

sudo /etc/init.d/networking restart

Undo an add in mercurial:

hg status -an0 | xargs -0 hg revert
```

Check linux kernel version and processor type:

```shell
uname -a
```

Show how much disk space remains and show how big the files/directories in the current directory are.

```shell
df -h
du -sh *
```

Ports in use:

```shell
sudo netstat -taupen
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment