Commands tagged odm (1)

  • For a given filesystem return the LUN ID. Command assumes 1:1 relationship between fs:lv:hdisk:lun which may not be the case in all environments. Show Sample Output


    0
    getlunid() { lv=$(df -P $1|grep "^/dev/"|awk '{print $1}'|awk -F/ '{print $3}'); hd=$(lslv -l $lv|tail -1|awk '{print $1}');id=$(odmget -q "name like $hd AND attribute=unique_id" CuAt|grep "value ="|awk -F= '{print $2}'|tr -d '"');echo $id;}
    bigstupid · 2014-04-20 18:43:21 6

What's this?

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.

Share Your Commands


Check These Out

Print lines in a text file with numbers in first column higher or equal than a value
A text file contains thousands of numbers. This command prints lines were the number is greater or equal than a specified value (134000000).

Find all active ip's in a subnet

Speed up builds and scripts, remove duplicate entries in $PATH. Users scripts are oftern bad: PATH=/apath:$PATH type of thing cause diplicate.

Have a random "cow" say a random thing
You need to have fortune and cowsay installed. It uses a subshell to list cow files in you cow directory (this folder is default for debian based systems, others might use another folder). you can add it to your .bashrc file to have it great you with something interesting every time you start a new session.

Kill any process with one command using program name
See also: killall

MySQL dump restore with progress bar and ETA
Display a progress bar while restoring a MySQL dump.

Remount an already-mounted filesystem without unmounting it
Necessary for fsck for example. The remount functionality follows the standard way how the mount command works with options from fstab. It means the mount command doesn't read fstab (or mtab) only when a device and dir are fully specified. After this call all old mount options are replaced and arbitrary stuff from fstab is ignored, except the loop= option which is internally generated and maintained by the mount command. It does not change device or mount point.

Select rectangular screen area
Hold 'Ctrl' + 'Alt' key while selecting rectangular text area of the screen with left mouse button. Should work in any terminal screen (xterm, konsole, ...) under X, if not then try with 'Ctrl' + 'Shift' + 'Alt' or two-combination of these.

Extract title from HTML files
previous version leaves lots of blank lines

Clone all repos from a user with lynx
https://wuseman.github.io/wcloner/


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: