Useful Linux Commands

Determine Linux Distro and Version

lsb_release -a

and/or

cat /proc/issue

Change permissions on files to 644 and folders to 744

find . -type f | xargs chmod -v 644
find . -type d | xargs chmod -v 744

Install man page
cp manpage.1 /usr/local/share/man/man1
mandb1

Search for pattern in certain filetypes

grep --include=\*.{txt,csv,odt,ods} -rnw 'directory' -e "pattern"

Check if network port is open and listening

netstat -tnlp

use netcat to check if port is open

nc -vvzn IP PORT
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s