Commands tagged system information (1)

  • Quick and dirty hardware summary where lshw is not available. Requires util-linux, procps, pciutils, usbutils and net-tools, which should be preinstalled on most systems.


    3
    alias gethw='(printf "\nCPU\n\n"; lscpu; printf "\nMEMORY\n\n"; free -h; printf "\nDISKS\n\n"; lsblk; printf "\nPCI\n\n"; lspci; printf "\nUSB\n\n"; lsusb; printf "\nNETWORK\n\n"; ifconfig) | less'
    lordtoran · 2021-04-03 00:41:12 364

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

Generate a random password 30 characters long
This command is similar to the alternate, except with head(1), you can pick as many passwords as you wish to generate by changing the number of lines you wish to preview.

Manipulate the metadata when the photo was taken, this will shift with +15hours + 30min

let the cow suggest some commit messages for you
No need to parse html page, website gives us a txt file :)

Emulate tail using awk.
This awk codes emulates tail. For efficiency it uses a circular array, which stores only N number of records. Using awk gives the flexibility of modifying the output as needed, for example adding the record number (NR) at the output and much more.

give a binary the ability to open ports below 1024 as non root user
Binding a server to privileged port on Linux w/o running as root This is applicable to any service using privileged ports (< 1024), for instance to run a HTTP server on port 80 or a LDAP directory server on port 389 for example.

Colorful man
That command installs "most" and make this command as the default man reader. The "most" works like "less" (the current man reader), but it render colors for manpages and may do more things. Read "man most". You can see a preview here: http://www.dicas-l.com.br/dicas-l/20090718.php

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

display a smiling smiley if the command succeeded and a sad smiley if the command failed
you could save the code between if and fi to a shell script named smiley.sh with the first argument as and then do a smiley.sh to see if the command succeeded. a bit needless but who cares ;)

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

Convert Unix newlines to DOS newlines
The ctrl+v,ctrl+m portion represents key presses that you should do. If you do it successfully you should see a ^M character appear.


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: