Command Line. Or. How I faced my Demons and Overcame them. By finding RTFM. - rokytnji - 01-21-2015
You'll find the vast majority of commands on your system using this command:
also, some admin commands:
Code: ls -l /sbin /usr/sbin
to read the manual page for a command ('grep', for example)
some commands also have info pages, like:
you can get some more info about a program by executing it with the --help switch
If this unedjucated scooter tramp can tread where smarter minds than his fear to tread. So can you.
Just a example
Code: harry@biker1:~$ ifconfig --help
Usage:
ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [metric <NN>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[multicast] [[-]promisc]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
[txqueuelen <NN>]
[[-]dynamic]
[up|down] ...
<HW>=Hardware Type.
List of possible hardware types:
loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
ash (Ash) ether (Ethernet) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
irda (IrLAP) ec (Econet) x25 (generic X.25)
eui64 (Generic EUI-64)
<AF>=Address family. Default: inet
List of possible address families:
unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)
ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)
ash (Ash) x25 (CCITT X.25)
Someone asks you on a forum. What does "ifconfig -a" say is available for your connections? You are like WTF does he mean?
Now you get a better Idea. Same when someone says "inxi -F"
Code: harry@biker1:~$ inxi --help
inxi supports the following options. You can combine them, or list them one
by one. Examples: inxi -v4 -c6 OR inxi -bDc 6. If you start inxi with no
arguments, it will show the short form.
The following options if used without -F, -b, or -v will show just option
line(s): A, C, D, G, I, M, N, P, R, S, f, i, m, n, o, p, l, u, r, s, t - you
can use these alone or together to show just the line(s) you want to see. If
you use them with -v [level], -b or -F, it will show the full output for that
line along with the output for the chosen verbosity level.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Output Control Options:
-A Audio/sound card information.
-b Basic output, short form. Like inxi -v 2, only minus hard disk names.
-c Color schemes. Scheme number is required. Color selectors run a color
selector option prior to inxi starting which lets you set the config
file value for the selection.
Supported color schemes: 0-32 Example: inxi -c 11
Color selectors for each type display (NOTE: irc and global only show
safe color set):
94 Console, out of X
95 Terminal, running in X - like xTerm
96 Gui IRC, running in X - like Xchat, Quassel, Konversation etc.
97 Console IRC running in X - like irssi in xTerm
98 Console IRC not in X
99 Global - Overrides/removes all settings. Setting specific removes
global.
-C CPU output, including per CPU clockspeed (if available).
-d Optical drive data. Same as -Dd. See also -x and -xx.
-D Full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB.
See also -x and -xx. Disk total used percentage includes swap partition
size(s).
-f All cpu flags, triggers -C. Not shown with -F to avoid spamming. ARM
cpus show 'features'.
-F Full output for inxi. Includes all Upper Case line letters, plus -s and
-n. Does not show extra verbose options like -d -f -l -m -o -p -r -t -u
-x
-G Graphic card information (card, display server type/version,
resolution, glx renderer, version).
-i Wan IP address, and shows local interfaces (requires ifconfig network
tool). Same as -Nni. Not shown with -F for user security reasons, you
shouldn't paste your local/wan IP.
-I Information: processes, uptime, memory, irc client (or shell type),
inxi version.
-l Partition labels. Default: short partition -P. For full -p output, use:
-pl (or -plu).
-m Memory (RAM) data. Physical system memory array(s), capacity, how many
devices (slots) supported, and individual memory devices (sticks of
memory etc). For devices, shows device locator, size, speed, type
(like: DDR3). Also see -x, -xx, -xxx
-M Machine data. Motherboard, Bios, and if present, System Builder (Like
Lenovo). Older systems/kernels without the required /sys data can use
dmidecode instead, run as root. Dmidecode can be forced with -! 33
-n Advanced Network card information. Same as -Nn. Shows interface, speed,
mac id, state, etc.
-N Network card information. With -x, shows PCI BusID, Port number.
-o Unmounted partition information (includes UUID and LABEL if available).
Shows file system type if you have file installed, if you are root OR
if you have added to /etc/sudoers (sudo v. 1.7 or newer)
Example: <username> ALL = NOPASSWD: /usr/bin/file
-p Full partition information (-P plus all other detected partitions).
-P Basic partition information (shows what -v 4 would show, but without
extra data). Shows, if detected: / /boot /home /tmp /usr /var. Use -p
to see all mounted partitions.
-r Distro repository data. Supported repo types: APT; PACMAN; PISI; YUM;
URPMQ; Ports.
-R RAID data. Shows RAID devices, states, levels, and components, and
extra data with -x/-xx. md-raid: If device is resyncing, shows resync
progress line as well.
-s Sensors output (if sensors installed/configured): mobo/cpu/gpu temp;
detected fan speeds. Gpu temp only for Fglrx/Nvidia drivers. Nvidia
shows screen number for > 1 screens.
-S System information: host name, kernel, desktop environment (if in X),
distro
-t Processes. Requires extra options: c (cpu) m (memory) cm (cpu+memory).
If followed by numbers 1-20, shows that number of processes for each
type (default: 5; if in irc, max: 5): -t cm10
Make sure to have no space between letters and numbers (-t cm10 -
right, -t cm 10 - wrong).
-u Partition UUIDs. Default: short partition -P. For full -p output, use:
-pu (or -plu).
-v Script verbosity levels. Verbosity level number is required. Should not
be used with -b or -F
Supported levels: 0-7 Example: inxi -v 4
0 Short output, same as: inxi
1 Basic verbose, -S + basic CPU + -G + basic Disk + -I.
2 Networking card (-N), Machine (-M) data, shows basic hard disk
data (names only), and, if present, basic raid (devices only, and
if inactive, notes that). similar to: inxi -b
3 Advanced CPU (-C), network (-n) data, and switches on -x advanced
data option.
4 Partition size/filled data (-P) for (if present): /, /home,
/var/, /boot. Shows full disk data (-D).
5 Audio card (-A); sensors (-s), memory/ram (-m), partition
label (-l) and UUID (-u), short form of optical drives, standard
raid data (-R).
6 Full partition (-p), unmounted partition (-o), optical drive
(-d), full raid; triggers -xx.
7 Network IP data (-i); triggers -xxx.
-w Local weather data/time. To check an alternate location, see:
-W <location>. For extra weather data options see -x, -xx, and -xxx.
-W <location> Supported options for <location>: postal code; city,
state/country; latitude/longitude. Only use if you want the weather
somewhere other than the machine running inxi. Use only ascii
characters, replace spaces in city/state/country names with '+'.
Example: inxi -W new+york,ny
-x Adds the following extra data (only works with verbose or line output,
not short form):
-C CPU Flags, Bogomips on Cpu;
-d Extra optical drive data; adds rev version to optical drive.
-D Hdd temp with disk data if you have hddtemp installed, if you are
root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer)
Example: <username> ALL = NOPASSWD: /usr/sbin/hddtemp
-G Direct rendering status for Graphics (in X).
-G (for single gpu, nvidia driver) screen number gpu is running on.
-i IPv6 as well for LAN interface (IF) devices.
-I System GCC, default. With -xx, also show other installed GCC
versions. If running in console, not in IRC client, shows shell
version number, if detected. Init/RC Type and runlevel (if
available).
-m Part number; Max memory module size (if available).
-N -A Version/port(s)/driver version (if available) for Network/Audio;
-N -A -G Network, audio, graphics, shows PCI Bus ID/Usb ID number of card.
-R md-raid: Shows component raid id. Adds second RAID Info line:
raid level; report on drives (like 5/5); blocks; chunk size;
bitmap (if present). Resync line, shows blocks synced/total
blocks. zfs-raid: Shows raid array full size; available size;
portion allocated to RAID
-S Desktop toolkit if avaliable (GNOME/XFCE/KDE only); Kernel gcc
version
-t Memory use output to cpu (-xt c), and cpu use to memory (-xt m).
-w -W Wind speed and time zone (-w only).
-xx Show extra, extra data (only works with verbose or line output, not
short form):
-A Chip vendor:product ID for each audio device.
-D Disk serial number.
-G Chip vendor:product ID for each video card.
-I Other detected installed gcc versions (if present). System
default runlevel. Adds parent program (or tty) for shell info if
not in IRC (like Konsole or Gterm). Adds Init/RC (if found)
version number.
-m Manufacturer, Serial Number, single/double bank (if found).
-M Chassis information, bios rom size (dmidecode only), if data for
either is available.
-N Chip vendor:product ID for each nic.
-R md-raid: Superblock (if present); algorythm, U data. Adds system
info line (kernel support,read ahead, raid events). If present,
adds unused device line. Resync line, shows progress bar.
-S Display manager (dm) in desktop output, if in X (like kdm, gdm3,
lightdm).
-w -W Humidity, barometric pressure.
-@ 11-14 Automatically uploads debugger data tar.gz file to
ftp.techpatterns.com. EG: inxi -xx@14
-xxx Show extra, extra, extra data (only works with verbose or line output,
not short form):
-m Width of memory bus, data and total (if present and greater than
data); Detail, if present, for Type; module voltage, if
available.
-S Panel/shell information in desktop output, if in X (like
gnome-shell, cinnamon, mate-panel).
-w -W Location (uses -z/irc filter), weather observation time, wind
chill, heat index, dew point (shows extra lines for data where
relevant).
-y Required extra option: integer, 80 or greater. Set the output line
width max. Overrides IRC/Terminal settings or actual widths. If used
with -h, put -y option first. Example: inxi -y 130
-z Security filters for IP/Mac addresses, location, user home directory
name. Default on for irc clients.
-Z Absolute override for output filters. Useful for debugging networking
issues in irc for example.
Additional Options:
-h --help This help menu.
-H This help menu, plus developer options. Do not use dev options
in normal operation!
--recommends Checks inxi application dependencies + recommends, and
directories, then shows what package(s) you need to install to
add support for that feature.
-U Auto-update script. Will also install/update man page. Note: if
you installed as root, you must be root to update, otherwise
user is fine. Man page installs require root user mode.
-V --version inxi version information. Prints information then exits.
Debugging Options:
-% Overrides defective or corrupted data.
-@ Triggers debugger output. Requires debugging level 1-14 (8-10 - logging
of data). Less than 8 just triggers inxi debugger output on screen.
1-7 On screen debugger output
8 Basic logging
9 Full file/sys info logging
10 Color logging.
The following create a tar.gz file of system data, plus collecting the
inxi output to file. To automatically upload debugger data tar.gz file
to ftp.techpatterns.com: inxi -xx@ <11-14>
For alternate ftp upload locations:
Example: inxi -! ftp.yourserver.com/incoming -xx@ 14
11 With data file of xiin read of /sys.
12 With xorg conf and log data, xrandr, xprop, xdpyinfo, glxinfo etc.
13 With data from dev, disks, partitions, etc., plus xiin data file.
14 Everything, full data collection.
Advanced Options:
-! 31 Turns off hostname in output. Useful if showing output from servers etc.
-! 32 Turns on hostname in output. Overrides global B_SHOW_HOST='false'
-! 33 Forces use of dmidecode data instead of /sys where relevant (-M).
harry@biker1:~$
Now you can stride through a terminal like the giants. Head held high.
1st one I learned was when someone asked me. What does "cat /etc/issue" say?
So I
Happy Trailz , Rok
PS. Don't ask me to interpet. I am a slow study when it comes to code and like you. I learn as I go.
Re: Command Line. Or. How I faced my Demons and Overcame them. By finding RTFM. - gold_finger - 01-21-2015
Nice one rokytnji! Short, sweet and very useful!
Hope you don't mind -- I added "man" command to it.
Re: Command Line. Or. How I faced my Demons and Overcame them. By finding RTFM. - anon222 - 01-21-2015
Nice, always read the manual.
Introduction to using the shell on Linux
Search the man page with /
type /shell while reading the man intro
Search the man pages for a term
display one-line manual page descriptions with whatis.
pipes help when posts are long
Code: ls -l /bin /usr/bin | less
Code: ls -l /bin /usr/bin | more
q to quit
For internal shell commands.
Code: misko@misko-virtual-machine:~$ whatis help
help: nothing appropriate.
Re: Command Line. Or. How I faced my Demons and Overcame them. By finding RTFM. - rokytnji - 01-21-2015
No problemo gold_finger. This thread was meant to be added to anyways. Won't hurt my feelers.
Code: harry@biker1:~$ lspci -knn
00:00.0 Host bridge [0600]: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub [8086:2a40] (rev 07)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: agpgart-intel
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: i915
00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)
Subsystem: Dell Device [1028:0263]
00:1a.0 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 [8086:2937] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1a.1 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 [8086:2938] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1a.2 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 [8086:2939] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1a.7 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 [8086:293c] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: ehci-pci
00:1b.0 Audio device [0403]: Intel Corporation 82801I (ICH9 Family) HD Audio Controller [8086:293e] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: snd_hda_intel
00:1c.0 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 [8086:2940] (rev 02)
Kernel driver in use: pcieport
00:1c.1 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 [8086:2942] (rev 02)
Kernel driver in use: pcieport
00:1c.4 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 [8086:2948] (rev 02)
Kernel driver in use: pcieport
00:1d.0 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 [8086:2934] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1d.1 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 [8086:2935] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1d.2 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 [8086:2936] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: uhci_hcd
00:1d.7 USB controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 [8086:293a] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: ehci-pci
00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev 92)
00:1f.0 ISA bridge [0601]: Intel Corporation ICH9M LPC Interface Controller [8086:2919] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: lpc_ich
00:1f.2 SATA controller [0106]: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] [8086:2929] (rev 02)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: ahci
00:1f.3 SMBus [0c05]: Intel Corporation 82801I (ICH9 Family) SMBus Controller [8086:2930] (rev 02)
Subsystem: Dell Device [1028:0263]
02:01.0 CardBus bridge [0607]: Ricoh Co Ltd RL5c476 II [1180:0476] (rev ba)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: yenta_cardbus
02:01.1 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 04)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: firewire_ohci
02:01.2 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 21)
Subsystem: Dell Device [1028:0263]
Kernel driver in use: sdhci-pci
09:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5756ME Gigabit Ethernet PCI Express [14e4:1674]
Subsystem: Dell Device [1028:0263]
Kernel driver in use: tg3
0c:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
Subsystem: Dell Wireless 1397 WLAN Mini-Card [1028:000c]
Kernel driver in use: b43-pci-bridge
To monitor free space in real time on your internal hard drive
|