Unix gems

A page of Unix gems which I occasionally find useful:

List hosts on Network:
nmap -sP 10.0.0.0/24

list ports used:

netstat -na

lsof -i
or
sudo lsof -i :port

Copy lots of files between hosts:
rsync -r -v --progress -e ssh /home/user/ user@remote-system:/address/to/remote/file

Cronjobs:
crontab -e
- Opens an editor with the current crontab-file
crontab -l
- List the content of the current crontab-file
crontab -r
- Remove the current crontab-file
crontab FILENAME
- Set the current crontab-file to FILENAME

Symbolic links:
ln -sf filename symbolicname

Create a 2Mb file with random junk:
dd if=/dev/urandom of=~/foo.txt bs=1M count=2

Using tar to compress files:
tar -zcf filenavn.tar.gz *
Decompress:
tar -zxvf filenavn.tar.gz

Recursive grep'ping:
grep -R "server.configuration.dir" --include '*.xml' *

Ingen kommentarer:

Send en kommentar

Bemærk! Kun medlemmer af denne blog kan sende kommentarer.