This command will show who is logged into your system.
who
Entries Tagged as 'Linux Commands'
Who command
February 4th, 2010 by EZ linux · No Comments
Tags: Linux Commands
Show All Running Processes in Linux
January 21st, 2010 by EZ linux · No Comments
To see every process type:
ps -A
To see every process except what’s running from root type:
ps -U root -u root -N
Tags: Cheat Sheets · Linux Commands · Linux Tricks
Flushing iptables
January 21st, 2010 by EZ linux · No Comments
iptables can block many different things and often it will block good servers inside of a network. The best to see if it’s a iptables issue. Try to clean them out with this if you have CSF on the server:
csf -f
If you still have a issue try to stop iptables like this:
service iptables stop
Tags: Linux Commands · Linux Security · Linux Tricks
Rebooting a linux server
December 29th, 2009 by EZ linux · No Comments
The best way is:
shutdown -r now
This will tell the server to take it’s time so to speak and reboot when it’s ready.
For a hard reboot simply put:
reboot
In most cases a hard reboot is fine unless you have file errors and the servers needs to clean them up before a reboot.
Tags: Linux Commands
Tar and untar
November 27th, 2009 by EZ linux · 1 Comment
To get the files out of a tarball, you can use the following commands:
tar xvf something.tar
If the tarball has also been gzipped (compressed), you can use the following command:
tar xvfz something.tar.gz
If you only want certain directories from the tarball, do this:
tar xvzf something.tar.gz */dir.you.want/*
If you have a .tar.bz2 file, then you need bzip2 installed [...]
Tags: Linux Commands
Apache httpd failed ( apache error checking command )
September 8th, 2009 by EZ linux · No Comments
If apache ( httpd ) fails and says something like: httpd has failed, please contact the sysadmin.
Or just that is can’t work, the first step is to run the Linux command:
service httpd configtest
This should show any errors.
If you still get a error then you need to monitor the error_log file while you try to restart [...]
Tags: Linux Commands · Linux Software / Scripts · Linux Tricks
Sort and find a directory size
September 2nd, 2009 by EZ linux · 1 Comment
The easiest and fastest way is:
du -sh *
But if you want to search recursively and display in order you need this one:
du -h –max-depth=1 /home/ | sort -n -r
And if you want even more depth try:
du -s ./* | sort -n| cut -f 2-|xargs -i du -sh {}
I recommend trying all three with a fairly [...]
Tags: Linux Commands
Rsync
August 18th, 2009 by EZ linux · 1 Comment
rsync –delete –stats -vae ssh 12.123.123.123:/backup/cpbackup/daily/ /backup/cpbackup/daily/ –exclude-from ‘/root/exclude.txt’
I added the file exclude.txt because with this code you can have certain files not be transferred. In this case I added pending and spam emails.
So my exclude.txt file has this in it:
*.*.dwhs1234.dwhs.net
*.*.dwhs1234.dwhs.net:2,
*.*.dwhs1234.dwhs.net:2,*
*.msg”
core.*
*.*.mbox:2,
This is for a cpanel based server.
Tags: Linux Commands · Linux Software / Scripts
chown
August 17th, 2009 by EZ linux · No Comments
chown -R cali:cali public_html
-R means reciprocal
Tags: Linux Commands
skdetect
August 17th, 2009 by EZ linux · No Comments
wget http://tsd.student.utwente.nl/skdetect/skdetect-1.0pre4cvs
./skdetect-1.0pre4cvs
Tags: Linux Commands · Linux Security · Linux Software / Scripts
