Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Useful Terminal Commands.
#15
(09-26-2018, 04:34 PM)LIFE.LinuxIsForEveryone Wrote:
(09-02-2018, 02:13 AM)bob777 Wrote: Over the last two years I've collected some very useful Commands that I’d like
to share...that you can run in the Terminal...these Commands will not harm
your System...please feel free to add more.

Graphics card Information...   inxi -SGxx

CPU Info...   lscpu

What OS are you using...  inxi -S

Computer Information...   inxi -Fxzd   

System info...   sudo lshw > lshw.txt

How Much Ram do I Have...   free -m

What Kernel Version Do I Have...   uname -r
Great post bob777! There's some of these I'l definitely notate and use going forward, and there's some that I already use a different variation of. 

*** A quick heads-up; many Distros (to my dismay) do not come with inxi out of the box. For any Ubuntu based Distro, first run $ sudo apt install inxi -yy ***

Examples of what I use that are similar to some of the above I quoted:
$ inxi -F
$ inxi -F |less
$ inxi -F > inxi.txt
(Be sure to use a CAPITAL "F" - it makes a difference)
--- I like to use this because it shows me EVERYTHING! The CPU, GPU, RAM, System, the whole nine yards. Granted some people may like smaller chunks, but I prefer this [one] command to view everything I want to know at one time

$ uname -a
--- More verbose than uname -r is all; again shows a bit more info

$ free -h
$ free -m
$ free -g
--- All essentially do the same thing, but I've gotten used to using -h [human readable] because if there are <1GB it auto-magically shows MB's, and if >1GB it shows the amount in GB's

A couple extras which are add-ons to commands:
-yy
&&

Anytime I run updates, install programs via terminal, and so on, I've gotten to always adding "-yy" after the command; Yes, some say "that's risky" because it tells the system to enter "YES" to any prompts that would normally come up, however, I make sure I know what I'm intending to install ahead of time. If it's something new that's I've never installed on a specific Distro before, or something I've never installed before at all, then I forego that part of the command. Otherwise, it's a nice time-saver to only have to enter in one command.

EXAMPLE: sudo apt dist-upgrade -yy


Whenever I install updates, or need to run multiple commands (FYI this is not needed for multiple program installs in-line), I use "&&" in between the commands. 

EXAMPLE: sudo apt update && sudo apt dist-upgrade -yy
--- This isn't needed for programs, as a user can simply space the programs out:$ sudo apt install inxi htop 


There's more of course, and I'm by NO means super-advanced, but I can finally hold my own with many commands from memory, vs just a year ago having to pretty much check the man page or web search everything. 

Cheers!

""Examples of what I use that are similar to some of the above I quoted:
$ inxi -F
$ inxi -F |less
$ inxi -F > inxi.txt
(Be sure to use a CAPITAL "F" - it makes a difference)
--- I like to use this because it shows me EVERYTHING! The CPU, GPU, RAM, System, the whole nine yards. Granted some people may like smaller chunks, but I prefer this [one] command to view everything I want to know at one time.""
#############################################################################

Hello LIFE.LinuxIsForEveryone,

That is some good stuff there for sure...

I noticed output issues on my system. On this command,

Code:
inxi -F |less 
and this command,

Code:
inxi -F >inxi.txt

both seem to interject the ASCI characters for the colors (I think) in the output. (At least for me)


So mine is like this for a clean output that is very readable...
Code:
inxi -F -c0 -Fxzd >inxi.txt

That takes the unwanted characters out of the output and it is readable....
I have this in a script I pieced together to do just what you said you use it for. I need to know what things are...LOL
Of course that is not the way I do the output, I use a "variable" of "$HOSTNAME" to set the output file to "System-name.info"

Here is the piece I use at the end of the script:
Code:
 

echo -e "File created: $today\n"
inxi -c0 -Fxzd
} >> "$infofile"
#
# Display the file to the screen
#
 cat "$infofile"
#
# Finished Section
#
echo
echo " :>" "Here You Go "$USER"!!" "I Found The Data You Requested"
echo
echo " :>" "Here Is The Data For "$HOSTNAME"'s"" System Information You Wanted....."
echo " :>" "Thank You For Using Your Hal-9000 Computer"
echo " :>" "Goodbye Bruce!"
echo "=============="
exit

Of course there is more to this... This is the part that pertains to the post...

It may not be the best code in the world but it works for me and does what I want...  Wink
I am no coder by no means and have been on linux for almost two years and I poke at everything
to see how it works..... Yep! I break stuff too.. That's what XBT is for.... Lol

I thought the "HAL- 9000" part was neat...

Thanks again for the post.... Later!
**********************************************************
Taglines of the BBS Days:
Today is the tomorrow you worried about yesterday. 
  Everybody remember where we parked. - Kirk
    Not everything in life is a 1 or a 0.
       Experience enables you to recognise a mistake when you make it again...
Reply


Messages In This Thread
Useful Terminal Commands. - by bob777 - 09-02-2018, 02:13 AM
RE: Useful Terminal Commands. - by Cthulhu - 09-02-2018, 02:26 AM
RE: Useful Terminal Commands. - by leon.p - 09-02-2018, 01:56 PM
RE: Useful Terminal Commands. - by bescott9944 - 09-07-2018, 12:27 AM
RE: Useful Terminal Commands. - by leon.p - 09-26-2018, 07:31 PM
RE: Useful Terminal Commands. - by bescott9944 - 06-07-2019, 05:12 AM
RE: Useful Terminal Commands. - by inraidius - 09-27-2018, 02:29 PM
RE: Useful Terminal Commands. - by SirGuyCarleton - 09-27-2018, 11:23 PM
RE: Useful Terminal Commands. - by rick forges - 09-28-2018, 10:01 PM
RE: Useful Terminal Commands. - by leon.p - 10-01-2018, 01:22 PM
RE: Useful Terminal Commands. - by waterismygod - 02-04-2019, 02:02 PM
RE: Useful Terminal Commands. - by Cthulhu - 03-23-2019, 09:47 AM
RE: Useful Terminal Commands. - by leon.p - 03-25-2019, 06:59 PM
RE: Useful Terminal Commands. - by smartin - 07-03-2019, 10:20 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)