June 2008
The Archives
-
06.28.08Displaying all active processes$ ps -ef Shows all the active processes in extendend column format.
-
06.25.08Time of last system reboots$ last reboot reboot system boot 2.6.24-19-generi Wed Jun 18 13:48 - 09:18 (5+19:29) reboot system boot 2.6.24-18-generi Fri Jun 13 07:37 - 13:47 (5+06:10) reboot system boot 2.6.24-18-generi Thu Jun 12 16:26 - 17:30 (01:03) System boot history.
-
06.22.08Displaying a calendar$ cal -3 may 2008 june 2008 july 2008 mo tu we th fr sa su mo tu we th fr sa su mo tu we th fr sa su 1 2 3 4 1 ...
-
06.19.08Open files$ lsof Shows info on all the open 'files'. An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, stream or a network file...
-
06.17.08comm, common lines in two filesGiven two ordered files, like $ cat foo abbreviation carnivore meal topology and $ cat bar aristide meal nap scout topology zero comm prints, in succession and in a three-column format, the lines corresponding exclusively to the first file (first column), exclusively to the second file (second column) and to both of them (third column). Thus, $ comm foo bar abbreviation aristide carnivore meal nap scout ...
-
06.15.08More on bash historyBash provides a powerful history system that helps you in repeating commands and arguments. For example, the !! command, repeats the last executed command. If you want to execute a command typed before the last one, you can select it with the following: !-number Something like this: $ ls $ ps $ !-2 The last command executes ls again. In addition, you can specify previous arguments too. This is done with the !:n command (n being a number). Let's see an example: $ less file.txt $ cp !:1 file_copy.txt The last command takes the first argument of the previous executed command and makes a copy with a different name. If this is not ...
-
06.15.08Knowing when a user last logged in# lastlog -u rafacas Username Port From Latest rafacas pts/5 192.168.1.16 mar jun 10 13:36:46 +0200 2008 Prints the contents of the 'last logging' log file (/var/log/lastlog) for the specified user.
-
06.11.08Identifying a network card# ethtool -p eth0 5 Makes the interface lights on a NIC (eth0) blink for 5 seconds to help identify it
-
06.08.08Displaying virtual memory data$ vmstat 5 5 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 0 1468896 23356 354528 0 0 101 28 70 642 4 1 94 2 0 0 0 1468888 23356 354528 ...
-
06.06.08Opening a file with vi at a specified string (regexp)$ vi +/id /etc/inittab Opens the file and places the cursor at the first ocurrence of the 'id' string. Works with regexps.