LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > ondoho
User Name
Password

Notices


Rate this Entry

How to use CODE Tags for Code and Command Output

Posted 08-23-2021 at 12:54 AM by ondoho

Let's say you have this output:

$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 789M 2.7M 787M 1% /run
/dev/sda8 9.8G 6.9G 2.5G 74% /

You will notice that the formatting is messed up, it looked much nicer in your terminal!

Instead, you should surround the text with code tags:

[CODE]
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 789M 2.7M 787M 1% /run
/dev/sda8 9.8G 6.9G 2.5G 74% /
[/CODE]

The end result will then look like this:
Code:
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           789M  2.7M  787M   1% /run
/dev/sda8       9.8G  6.9G  2.5G  74% /
This increases readability by a lot for everyone, especially people trying to interpret it for you, so please take this advice seriously.

The tags are case insensitive - you can use [code] bla bla [/code] just as well.

You do not have to type it all out, either: in the advanced post editor you will find this sign: # in the toolbar, clicking it once will output a pair of empty code tags. Try it.

If you have already posted some code without tags, you can go back to the post in question, click the [ Edit ] button (bottom right), and edit your post accordingly.

Thank You.
Posted in Uncategorized
Views 1680 Comments 5
« Prev     Main     Next »
Total Comments 5

Comments

  1. Old Comment

    Another way to post info (esp if you can't use copy&paste): |nc termbin.com 9999

    One other way (esp if you "can't" use copy&paste) is:

    |nc termbin.com 9999

    like <some command(s), even cat aFile> | nc termbin.com 9999

    You can look at the website http://termbin.com for more info (9999 is a network 'port')

    You could even combine commands in a subshell, like:
    Code:
    $ (uname -a; df .; sudo inxi -mx; free) | nc termbin.com 9999
    https://termbin.com/uorq
    The info can be seen via the URL returned (expires after a while)

    An example file to `cat` is /var/log/Xorg.0.log

    Also, another way to capture things into a file is the script [filename] command. See: man script

    This blog has info on the "Go Advanced" button (to get the # in the toolbar), and noparse (to display the code tags). The "BB Code" link (at the bottom of posts) documents all tags.

    p.s. note the "Rate this (blog) Entry" at top enables us to give ondoho the 5stars they deserve
    Posted 09-01-2021 at 05:41 PM by GentleThotSeaMonkey GentleThotSeaMonkey is offline
    Updated 09-01-2021 at 11:58 PM by GentleThotSeaMonkey
  2. Old Comment
    /dev/disk/by-id/usb-WD_Elements_2621_57583832454130415945334D-0:0 /mnt/usb-WD_Elements_2621_57583832454130415945334D-0:0 auto nosuid,nodev,nofail,x-gvfs-show 0 0
    Posted 07-15-2022 at 03:54 AM by piotrbujakowski piotrbujakowski is offline
  3. Old Comment
    What I have here and will post is the log from the Yast var/log/messages at what I think is the correct time of issue.
    When I experience the Black screen again I will go fetch the log again. Making note of the time.
    If you gave the terminal command and Tags to filter the log I would be happy to try my hand at this.
    The terminal that is... but in the past I have often gotten myself confused because of all the different command prompts that were not always for Opensuse 15.3
    I am going to post quite a bit because as I was scrolling up I saw what look like issues with Plasma+xorg+nvidia+noveau.
    Not sure...hard to understand what I am looking at
    **************************************************************************************************** ***********************

    2023-06-07T01:31:47.685165-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 13476, resource id: 8388919, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:31:50.405814-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 13741, resource id: 33555025, major code: 3 (GetWindowAttributes), minor code: 0
    2023-06-07T01:33:44.188639-05:00 localhost plasmashell[4913]: qml: applet destroyed
    2023-06-07T01:33:44.243495-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 15101, resource id: 65011733, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:33:44.295744-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 15131, resource id: 8388920, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:36:27.473948-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 24070, resource id: 62914568, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:36:35.538246-05:00 localhost kdeinit5[13191]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:36:35.871006-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 24087, resource id: 62914568, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:37:05.177663-05:00 localhost smartd[1429]: Device: /dev/sda [SAT], 1 Currently unreadable (pending) sectors
    2023-06-07T01:37:05.177971-05:00 localhost smartd[1429]: Device: /dev/sda [SAT], 1 Offline uncorrectable sectors
    2023-06-07T01:37:29.527988-05:00 localhost kdeinit5[13208]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:37:38.718413-05:00 localhost dolphin[6609]: QCoreApplication:ostEvent: Unexpected null receiver
    2023-06-07T01:37:39.752119-05:00 localhost dolphin[6609]: message repeated 56 times: [ QCoreApplication:ostEvent: Unexpected null receiver]
    2023-06-07T01:40:12.346770-05:00 localhost kdeinit5[13262]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:40:16.114469-05:00 localhost kdeinit5[13272]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:40:19.693562-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 37600, resource id: 65011720, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:40:19.803506-05:00 localhost kdeinit5[13281]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:41:55.029854-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 41711, resource id: 62914568, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:41:55.667038-05:00 localhost kdeinit5[13312]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:41:56.118477-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 41738, resource id: 62914568, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:41:56.419298-05:00 localhost kdeinit5[13319]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:42:03.144070-05:00 localhost kdeinit5[13329]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:42:03.284964-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 41901, resource id: 62914568, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:42:13.626594-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 43946, resource id: 8388952, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:42:15.005896-05:00 localhost kwin_x11[4882]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 43950, resource id: 35652095, major code: 18 (ChangeProperty), minor code: 0
    2023-06-07T01:42:30.643341-05:00 localhost ksmserver[4841]: lock called
    2023-06-07T01:42:31.614664-05:00 localhost ksmserver[4841]: Lock window Id: 27262995
    2023-06-07T01:42:32.553355-05:00 localhost ksmserver[4841]: CreateNotify: 27262995
    2023-06-07T01:42:37.012711-05:00 localhost ksmserver[4841]: CreateNotify: 8388612
    2023-06-07T01:42:37.316093-05:00 localhost kscreenlocker_greet[13345]: Qt: Session management error: networkIdsList argument is NULL
    2023-06-07T01:42:37.778820-05:00 localhost ksmserver[4841]: CreateNotify: 8388616
    2023-06-07T01:42:37.790797-05:00 localhost ksmserver[4841]: CreateNotify: 8388621
    2023-06-07T01:42:38.202336-05:00 localhost ksmserver[4841]: CreateNotify: 8388623
    2023-06-07T01:42:39.756470-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/wallpapers/org.kde.image/contents/ui/main.qml:76:9: Unable to assign [undefined] to QStringList
    2023-06-07T01:42:39.756694-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/wallpapers/org.kde.image/contents/ui/main.qml:75:9: Unable to assign [undefined] to int
    2023-06-07T01:42:39.758191-05:00 localhost ksmserver[4841]: CreateNotify: 8388625
    2023-06-07T01:42:39.758394-05:00 localhost ksmserver[4841]: CreateNotify: 8388627
    2023-06-07T01:42:39.761132-05:00 localhost ksmserver[4841]: MapNotify: 8388625
    2023-06-07T01:42:39.766101-05:00 localhost ksmserver[4841]: CreateNotify: 8388629
    2023-06-07T01:42:47.809983-05:00 localhost kscreenlocker_greet[13345]: UdevQt: unable to create udev monitor connection
    2023-06-07T01:42:48.023278-05:00 localhost ksmserver[4841]: CreateNotify: 8388632
    2023-06-07T01:42:48.127387-05:00 localhost kscreenlocker_greet[13345]: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
    2023-06-07T01:42:48.541575-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/SessionManagementScreen.qml:64:5: Unable to assign [undefined] to int
    2023-06-07T01:42:48.541992-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/ActionButton.qml:33:5: Unable to assign [undefined] to int
    2023-06-07T01:42:48.542240-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/KeyboardLayoutButton.qml:29:5: Unable to assign [undefined] to int
    2023-06-07T01:42:48.570634-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/Battery.qml:48:9: Unable to assign [undefined] to double
    2023-06-07T01:42:48.580329-05:00 localhost kscreenlocker_greet[13345]: file:///usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/UserDelegate.qml:41:5: Unable to assign [undefined] to int
    Posted 06-07-2023 at 09:22 PM by rnott2003 rnott2003 is offline
  4. Old Comment
    Ah ! only 10K characters allowed and I deleted a lot of it so it would post
    Posted 06-07-2023 at 09:23 PM by rnott2003 rnott2003 is offline
  5. Old Comment
    Sorry wrong place to post
    Posted 06-07-2023 at 09:28 PM by rnott2003 rnott2003 is offline
 

  



All times are GMT -5. The time now is 07:55 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration