This command allows you to find the effective uid and gid of the Apache process regardless of process name (which can be apache2 or httpd depending on distro).
Set field separator char from command line. Prints first, second and lsat columns. Show Sample Output
Require wmctrl and gpicker and an EWMH/NetWM compatible X Window Manager
Shorter version with curl and awk
This will look through file and print the data in between the pattern matches. It's great for restoring tables from a mysqldump backup. You can then import it back into your database with:
mysql -u <user> -h <host> <database> < restored_table.sql
Tested on CentOS, Ubuntu, and MacOS.
Find your default gateway and print it directly output. http://www.bayner.com/ kerim@bayner.com Show Sample Output
Essentially the same as funky's alias, but will not traverse filesystems and has nicer formatting. Show Sample Output
'ac' is included in the package 'acct', which is described as "The GNU Accounting utilities for process and login accounting". Other interesting flags are:
* print statistics for a specified user
ac -d username
* print statistics for all the users
ac -p
With my command, the output is also printed in a sexagesimal, more readable, style.
Show Sample Output
This is an easy way to quickly get a status for a device in multipath on SLES systems, as long as the server is configured based on Novell's standards, where multipathed disks are referred to by /dev/disk/by-... tree. Make sure to replace name_of_vg with your Volume Group name.
This alternative cleans HISTTIMEFORMAT environment variable and calls gnuplot just after /tmp/cmds is closed, to avoid some errors.
the command will not include hidden files Show Sample Output
I found Flash eating one of my CPUs after resume, the command above will help with that. For optional kicks you can put it into a script in /etc/pm/sleep.d/ (aspect in #swhack wrote this for me)
Problem: you want to output one line per file. you can't just 'tr -d' because you want one line per file and you don't want to use a loop. Solution: use awk to print each line without the record separator and a newline after each file. Show Sample Output
open a new tab in active gnome-terminal instance needs sudo apt-get install xdotool and sudo apt-get install wmctrl
awk extract every nth line. Generic is: awk '{if (NR % LINE == POSITION) print $0}' foo where "last" position is always 0 (zero). Show Sample Output
same thing as the other
Tested on Solaris.
Same thing just a different way to get there. You will need lynx
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: