Differences

This shows you the differences between the selected revision and the current version of the page.

technology:unix:useful_commands 08.27.2010 18:37 technology:unix:useful_commands 03.18.2013 05:53 current
Line 6: Line 6:
                                                'A' = show many windows; 'a,w' = navigate windows; 'z' = color; 'x' = highlight sort col                                                 'A' = show many windows; 'a,w' = navigate windows; 'z' = color; 'x' = highlight sort col
                                                shift-w = save it too your .toprc                                                 shift-w = save it too your .toprc
 += Finding Stuff =
 +find / -name "file_name" -print                ; find file name from root directory path (/)
 +find . -user root                              ; find files owned by root user, in current directory (.)
 +locate -i fstab                                ; find file name in database that keeps track of filenames
 +find . -type f -user zenoss -name "*.py" -exec grep -il "blah" {} \;
 +                                                ; find text "blah" in .py files belonging to zenoss user
 +locate Data.fs | xargs ls -l                    ; xargs to pipe results of one command to another
 +find ./ -name '*py' | xargs grep signal        ; Find string "signal" inside text of .py files; xargs looks inside the files instead of at the file name
 +grep -ir "timeout" .                            ; find the string "timeout" in any file below the current dir
= Various = = Various =
Line 19: Line 28:
wget <http url>                                ; download a file from the web wget <http url>                                ; download a file from the web
sar                                            ; system activity reporter sar                                            ; system activity reporter
- 
-= Finding Stuff = 
-find / -name "file_name" -print                ; find file name from root directory path (/) 
-find . -user root                              ; find files owned by root user, in current directory (.) 
-locate -i fstab                                ; find file name in database that keeps track of filenames 
-find . -type f -user zenoss -name "*.py" -exec grep -il "blah" {} \; 
-                                                ; find text "blah" in .py files belonging to zenoss user 
-locate Data.fs | xargs ls -l                    ; xargs to pipe results of one command to another 
-find ./ -name '*py' | xargs grep signal        ; Find string "signal" inside text of .py files; xargs looks inside the files instead of at the file name 
- 
du -k ~ | more                                  ; show disk usage (useful for over quota) for home directory du -k ~ | more                                  ; show disk usage (useful for over quota) for home directory
Line 57: Line 56:
ps -A -o pid,state,command | grep D            ; find process that's blocking due to IO wait ps -A -o pid,state,command | grep D            ; find process that's blocking due to IO wait
                                                ; 'D' is for Delayed processes, IO wait is most common cause                                                 ; 'D' is for Delayed processes, IO wait is most common cause
-grep -ir "timeout" .                            ; find the string "timeout" in any file below the current dir 
Line 64: Line 62:
lsof /media/documents/                          ; show list of files open lsof /media/documents/                          ; show list of files open
lsof / | grep media                            ; in case above doesnt work, lsof seems to work better on root and then grep it out for what you need lsof / | grep media                            ; in case above doesnt work, lsof seems to work better on root and then grep it out for what you need
 +lsof +D /var/log/                              ; list of files open under the given directory (recursive) (use +d for non-recurse)
Line 80: Line 79:
= Package Management = = Package Management =
rpm -qa                                        ; Packages installed on system rpm -qa                                        ; Packages installed on system
 +rpm -qa | grep httpd*                          ; See if httpd is installed
 +yum list installed httpd                        ; See if httpd is installed
yum provides /etc/fstab                        ; name of the package which contains a particular file yum provides /etc/fstab                        ; name of the package which contains a particular file
yum list                                        ; lists information about available packages yum list                                        ; lists information about available packages
 
technology/unix/useful_commands.1282948679.txt.gz · Last modified: 09.09.2010 09:52 by 74.103.32.54
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki