Every now and then I come across some really useful Linux command that I’m worried that I might forget about unless I write it down somewhere. That somewhere is here!
Show all rpm packages installed
rpm -qa | more
Install an rpm package
rpm -i packagename.rpm
Show all running processes
Find out if a particular process is running
for example, find out if httpd is running….
ben@ubuntu:~$ ps -C httpd PID TTY TIME CMD 5491 ? 00:00:00 httpd 5500 ? 00:00:00 httpd 5520 ? 00:00:00 httpd 5521 ? 00:00:00 httpd 5522 ? 00:00:00 httpd 5523 ? 00:00:00 httpd 5526 ? 00:00:00 httpd
Force quit a process or application that has stopped responding
kill -9 processID
How to find out which version (distro) of Linux you are running
Disk Usage (du)
display directory size
du -hx <source directory>
display directory size without subdirectories…
du -hsx <source directory>
list directory sizes of all directories in the current level – this is the most useful one really.
du -hsx *
Move a site over FTP without archiving first
wget -r --mirror --ftp-user=username --ftp-password=password ftp://site.domain.com/*