Commands by bigstupid (3)

  • This find syntax seems a little easier to remember for me when I have to use -prune on AIX's find. It works with gnu find, too. Add whatever other find options after -prune Show Sample Output


    0
    find /some/directory/* -prune -type f -name *.log
    bigstupid · 2014-05-02 00:14:32 1
  • Shows a tree of the disks. Requires "tree" Show Sample Output


    2
    tree /dev/disk
    bigstupid · 2014-04-20 18:56:56 0
  • 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 0

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

Check if *hardware* is 32bit or 64bit
This command tell you if your hardware is 32 or 64 bits even if you install a 32bits OS on a 64 bits hardware. If your distro don't support the -q switch, try doing : $ grep &>/dev/null '\' /proc/cpuinfo && echo 64 bits || echo 32 bits

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

Use md5sum to check your music and movie files. Also use diff.
This is a beginning script. You can create a file with > filename. You can also use diff to compare output run at different times to verify no change in your files. I apologize in advance if this is too simple. For some it should be a start.

convert all flac files in a folder to mp3 files with a bitrate of 192 kbps

Download and install the newest dropbox beta

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

List all TCP opened ports on localhost in LISTEN mode
Alternative of OJM snippet : This one show the IP too, where ports bind. It's very important, because if there's only 127.0.0.1 instead of 0.0.0.0, connections from internet are rejected.

Date shows dates at other times/dates
Use date to find the date at other days and times.

"Clone" a list of installed packages from one Debian/Ubuntu Server to another

Find public IP when behind a random router (also see description)
Depends on GET. You can also replace GET with curl, or `wget -qO -` if GET isn't available.


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: