Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

nevada

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

setup computer hostname in linux

* edit
/etc/sysconfig/network

* add the following lines:

HOSTNAME=www.test.com
DOMAINNAME=test.com

search with grep in linux


Searching files

grep (r - recursive, s - no messages, n -line number, i - case insensitve, H -with filename)
grep -rsniH your_string

match lines containing the string "I am a cat" or the string "I am a dog".
grep "I am a \(cat\|dog\)" 


Search application

to find PID (process ID) of a certain application or process,
pgrep


find application port
netstat -a | grep ftp

network utils


check port
netstat -l


Download files from the listed file.
wget -i <file> 
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS