DEV Community

wolfiton
wolfiton

Posted on

Five Linux commands that are very useful when requesting help

Hi everyone,

Today I am writing about five linux commands that can really offer useful information when you request help online.

 cat(concatenate)

The cat command can be used to view the content of a file without opening it.

it is very good to also redirect the content of a file to a new file, like this:

cat file1.txt > file2.txt

All the content of file1 will be copied to file 2.

Pretty handy right?

This feature is very good when you are in a hurry and don't want to deal with cp or rsync to copy something fast.

 uname(unix name)

uname is a good command when someone requests you to tell them what version is your operating system and what kernel are you running.

So uname -ar will give this output and display the version of the OS and the kernel that is currently in use.

 which(which)

The which command it is used to determine what program is bash using when you type a symlinked command like ls.

So typing which ls will tell us exactly what ls is Linux using to complete this task.

Let's type the command and see what it is the result:

which ls                                                                                 

ls: aliased to ls --color=tty

As you can see Dear Reader ls is part of the tty, the core of UNIX.

Unix is the operating system that was used to build Linux!

 journalctl(Events database)

Journalctl is very useful to see when a certain event has taken place on a Linux Operating System.

The jounralctl can be used also to filter the events and the older events are displayed first.

Let's try to filter our journalctl by date using the UTC argument:

journalctl --utc

 lsmod (list the drivers, ex: mouse, keyboard, motherboard.. so on)

Will list all driver modules that are currently enabled and help us identify if a blacklisted driver has not been successfully taken care of.

A very useful command to deal with driver issues.

Also to find more about any command in Linux, don't forget to use the man command followed by the command you want to find out more.

For example, let's find out more about the cat command:

man cat

I hope you enjoyed this article Dear Reader, and if you also find it useful share it on social.

Top comments (7)

Collapse
 
zilti_500 profile image
Daniel Ziltener

I can also highly recommend termbin.com. It is a pastebin where you can post to using netcat, aka the nc command. Just pipe whatever output to it, for example: cat test.txt | nc termbin.com 9999 creates an entry on termbin.com with the contents of test.txt.

Unix is the operating system that power all Linux distributions!

And this is wrong. Linux is Unix-like, but it doesn't even implement the UNIX standard completely (unlike the BSD systems like FreeBSD). On top of that, ls is a Bash built-in, not a system built-in.

Collapse
 
wolfiton profile image
wolfiton • Edited

Thanks for your opinion please see the article in my comment.

But after I read this I think my affirmation is not a false one.

Please read unix.stackexchange.com/questions/4...

Collapse
 
phlash profile image
Phil Ashby

I would strongly recommend reading the bug reporting advice from your chosen distribution too :)

Most popular distributions come with a bug reporting tool that collects all the relevant information and sends it to the triage team, for example Debian has 'reportbug', Ubuntu has 'ubuntu-bug', etc.

Collapse
 
wolfiton profile image
wolfiton

Very good point, to use the reporting tool.

Collapse
 
mohsin708961 profile image
{{7*7}}

Awesome

Collapse
 
wolfiton profile image
wolfiton • Edited

I am glad you enjoyed the article.

Collapse
 
wolfiton profile image
wolfiton

Also for any doubts regarding ls please read this en.wikipedia.org/wiki/Ls