/r/UnixProTips

Photograph via snooOG

A subreddit for sharing any helpful tips and hints you may have for Unix-like operating systems. We welcome all flavours. No flame wars or rudeness please. We are here to help each other and to learn. dotfiles, conf files, problems you have solved that may help others. We all have our own Unix pro tips. Share yours!

A subreddit for sharing helpful tips and hints you may have for any Unix-like OS. We welcome all flavours.

dotfiles, conf files, handy scripts and functions, problems you have solved that may help others. We all have our own Unix pro tips. Share yours!

 

No flame wars or rudeness please. We are here to help each other and to learn. With that being said, this is the Internet and not everyone is so nice. Disclaimer follows;

DO NOT BLINDLY RUN COMMANDS, SCRIPTS, ALIASES, FUNCTIONS OR ANYTHING ELSE YOU FIND IN THIS SUBREDDIT. IF YOU DO NOT FULLY UNDERSTAND WHAT IT IS GOING TO DO, EDUCATE YOURSELF, ASK FOR HELP AND BE SURE OF WHAT IT WILL DO BEFORE YOU USE IT. CONSIDER THIS YOUR ONLY WARNING.

 

Helpful subreddits

/r/vim

/r/awk

/r/commandline

/r/usefulscripts

/r/dailyprogrammer

/r/learnprogramming

 

Popular BSD distributions

NetBSD

PC-BSD

FreeBSD

OpenBSD

 

Popular GNU/Linux distributions

Arch

CRUX

Alpine

Debian

Ubuntu

Fedora

CentOS

Gentoo

Slackware

openSUSE

 

/r/UnixProTips

3,434 Subscribers

4

Fedora 40 how to install video codecs - RPM Fusion tutorial

0 Comments
2024/08/03
14:14 UTC

2

Install FreeBSD 14.0 in QEMU VM with KDE Plasma tutorial kdesrc-build Qt6

0 Comments
2024/01/27
15:37 UTC

2

Looking for a Linux & Unix Discord Community?

Are you passionate about Linux and Unix? 🐧

Do you want to connect with like-minded individuals, from beginners to experts? 🧠

Then you've found your new home. We're all about fostering meaningful connections and knowledge sharing.

🤔 Why We Exist: At the heart of our community is a shared love for Linux and Unix. We're here to connect with fellow enthusiasts, regardless of where you are on your journey, and create a space where our shared passion thrives.

🤨 How We Do It: We foster a welcoming environment where open conversations are the norm. Here, you can share your experiences, ask questions, and deepen your knowledge alongside others who are equally passionate.

🎯 What We Offer:

🔹 Engaging Discussions: Our discussions revolve around Linux and Unix, creating a hub of knowledge-sharing and collaboration. Share your experiences, ask questions, and learn from each other.

🔹 Supportive Environment: Whether you're a newcomer or a seasoned pro, you'll find your place here. We're all about helping each other grow. Our goal is to create a friendly and supportive space where everyone, regardless of their level of expertise, feels at home.

🔹 Innovative Tools: Explore our bots, including "dlinux," which lets you create containers and run commands without leaving Discord—a game-changer for Linux enthusiasts.

🔹 Distro-Specific Support: Our community is equipped with dedicated support channels for popular Linux distributions, including but not limited to:

Arch Linux

CentOS

Debian

Fedora

Red Hat

Ubuntu

...and many more!

Why Choose Us? 🌐

Our server aligns perfectly with Discord's guidelines and Terms of Service, ensuring a safe and enjoyable experience for all members. 🧐 📜 ✔️

Don't take our word for it—come check it out yourself! 👀

Join our growing community of Linux and Unix enthusiasts today let's explore, learn, and share our love for Linux and Unix together. 🐧❤️

See you on the server! 🚀

https://discord.gg/unixverse

0 Comments
2023/10/06
10:22 UTC

5

want a place to learn and share? see what ~vern is about

what is that?

~vern is an interactive community to learn about unix, the shell, internet protocols and much more. while it hosts a lot of services like privacy frontends or git hosting, it has a cozy community that always is there to help! if there's something you may be trying to do with a server, you could even use the pubnix available! ~vern is the greatest place to learn, communicate and discover linux! wanna see more?

0 Comments
2023/05/19
03:53 UTC

9

Linux Guide

Linux Guide. Learn about Linux Hardware vendors, Linux in the Cloud, Desktop Environents, Window mangers, Linux Distributions, Linux Security Hardening, Gaming (NVIDIA, AMD, Intel ARC), and Popular Software Apps.

1 Comment
2022/09/14
21:13 UTC

1

AM, the Application Manager that supports multiple architectures

0 Comments
2021/12/15
03:38 UTC

5

UPT of the day: In Emerge, Gentoo's package manager frontend, press [enter] instead of "y" to accept.

I wonder what other package managers have small tidbits like this?

7 Comments
2021/01/18
18:48 UTC

12

UPT of the Day: Modify your HISTCONTROL to have "ignorespace" to ignore all commands that start with a space in your history.

I find this super useful if you're entering a password or key in some command. Furthermore, I've heard that a lot of containerized package managers still give read access to your home directory - so in theory, all these applications have access to your whole history.

Bob.

0 Comments
2021/01/13
22:25 UTC

8

UPT Pro Guide

Unix is our favorite child. Flexible, applicable, customizable- wait, did you say customizable?

(this post is a work-in-progress, all recommendations accepted in the comments)

Vocabulary

  • POSIX-compliant: Being POSIX-compliant for an OS means that it supports those standards (e.g., APIs), and thus can either natively run UNIX programs, or at least porting an application from UNIX to the target OS is easy/easier than if it did not support POSIX. [superuser]

Shells

  • Bash: the default shell on most installations
  • Zsh: spelling correction, automation, and better plugin management
  • Fish: the non-POSIX oriented shell

Getting Help

IRC Channels:

  • #vim, #emacs

Discord servers:

  • Vi-tality, the vim and other things oriented server.
9 Comments
2021/01/13
13:24 UTC

6

Mods needed!

As I don't have time to moderate this subreddit and i hate to see people not being able to share what they want, I'm looking for someone to moderate this subreddit,

Just send me a dm if you're interested

Thanks

1 Comment
2021/01/12
11:15 UTC

8

Where do these panes come from? Thought they were kind of cool.

4 Comments
2020/03/25
16:50 UTC

3

Best shell prompt

What is your preferred *nix shell prompt (i.e.$PROMPT, $PS1, etc.) and why?

Plain “%” or “#? Or do you use something so complex that it takes up most of the line?

9 Comments
2019/10/18
07:30 UTC

2

Help training newbies

Please let me know if wrong please Reddit here,

Some help needed pls from Unix experts who have successfully trained others. Note I am far from a Unix expert myself.

Some context…. I work in a large UK Local government supporting a very core important system where the ICT Infrastructure/server (and its maintenance and DBA, is handled by a centralised ICT department/, who are often unable or unwilling to make changes to the server, as the supplier is quite specific).

The supplier also supports red hat as an alternative host OS to Solaris but....that's a bigger discussion, beyond my pay grade...

Anyway, we are way behind the curve, still using Solaris 11 and our Unix scripts are all #ksh. My team are by no means Unix experts (we have a few Unix managers within the ICT looking after the whole estate) but in my area...,we do just what we do… Log into putty/SSH, invoke Ingres's isql CLI command, write SQL, Create reports for managers here, and try and automate as much of this as possible by asking ICT to run the reports (shell scripts) as and when we can (system has a batch scheduler front end)

However, in my smaller team (outside of ICT, different building) we have (almost) full terminal server access in order to perform frequent day to day database changes using Ingres isql command, and fault resolution and help desk function for a particular Ingres based system (on Solaris) and the vast majority of this require back end access to said database.

We've asked many times for some kind of windows front end this backend Ingres database which would minimise risk around using the terminal, but never had a reply from ICT.

This is deemed to be a security risk by our internal auditors, however, we have managed to convince them otherwise due to the nature of the poor software which means that we often have to go in and change things our selves, and the supplier is reluctant to enhance it.

Anyway….

I now have to train up two people from scratch on this in two days. One knows the database layout but does not know how to write a shell script, so cannot truly exploit the automation scripting functionality therein.

The second guy, however, has a real keenness to learn and will pick up shell programming much easier as he has experience with other programming languages.

I am not a natural-born trainer and would be the first to tell them this. When they look at my scripts they don't understand them

I'm at a bit of a loss as to what to do here.

I wish I could clone a more patient version of me

Does anyone have any advice?

I can extend the training if needs be but it will be sporadic days here and there

I'm also very aware that over the years I have developed my own ways of doing singers which may not be the most efficient way of doing them…., . maybe more recent and better Unix commands exist to achieve the same things… But I have avoided these because of their perceived complexity eg awk ( I have avoided this like the plague because I never found the time to really understand it, but I'd like three trainees to hopefully understand it better than me and develop cleaner and more efficient solutions.

Any thoughts?

3 Comments
2019/08/02
07:36 UTC

6

Is there a good way to add lyrics to music library?

I have huge library of music, but the music player I use, does not download synced lyrics it only downloads static lyrics. The developer added an option, upon request, to use a local .lrc file as the lyrics source. I cannot find any good website to download the synced lyrics and my music library is very big. I cannot go adding .lrc files for individual songs. Is there an easier way of doing this? may be a tool (CLI or otherwise) that can crawl through my music library and add .lrc files?

0 Comments
2019/04/15
14:46 UTC

9

If you have pulseaudio installed but need to run a TTY session, you can still run start-pulseaudio-x11 for audio capabilities.

Tried this one day when I logged into a TTY but wanted to fire up cmus in a tmux session. Sure enough, it works. (That said, I didn't realize it was a simple shell script at the time. It's kind enough not to bail out even if it can't find a $DISPLAY.)

Nothing too special, but for those who didn't already know, it might make it just a little easier to entertain yourself during those otherwise tedious troubleshooting sessions.

4 Comments
2018/04/30
02:22 UTC

5

a custom Xfce xubuntu Install that takes 2 hours with script in video Description in 2017 | 48minutes duration

0 Comments
2018/04/01
09:41 UTC

2

Any suggestions on how to utilize ITEOC for text alerts?

1 Comment
2017/12/18
01:58 UTC

2

Spotify text formatting help

Has anyone come across a fix for changing the text size in Spotify? On high DPI screens the text is barely readable

1 Comment
2017/04/02
03:34 UTC

1

Google translate through the shell doesn't work

The google translate function written in this post doesn't seem to work for me. I just get a blank output in my case.

$ gt fr Donaudampfschiffkapitän

$ gt Donaudampfschiffkapitän

$ vi .bashrc

I'm using Ubuntu 16.04 64bit, with Firefox 47 (for which Mozilla/5.0 should work)

4 Comments
2016/07/23
07:13 UTC

9

Using for at the command line to ping multiple adresses.

for x in 1 2 3 4 5 6 7 8 9 10;

do ping 192.168.1."$x"; done

13 Comments
2015/08/11
03:18 UTC

7

Closing idle sessions per user

Our environment consists of CentOS and we have 5 login nodes (blades) that load balance for approximately 150 users via OpenLDAP authentication. We're noticing that folks are leaving sessions opened for as much as two months at a time, but they use these login nodes for a jumping off point to other blades where they can kick off such things as Matlab, gdb, ddd, etc.

We're having to reboot these blades from time to time because the firefox, NX and other resource-intensive programs yank too much CPU/memory and they end up becoming unresponsive. Probably a memory leak within the program(s) they're running, but the inherent problem seems to be that they simply don't remember to logout. Since each user has their own SHELL type, i.e. bash, ksh, csh, tcsh, etc., we'll have to create a . file in each of their home directories that contain the timeout for anything more than 7 days. The question is, would this be the way you all handle this or is there a more efficient approach? We can't set this in /etc/profile.d for various reasons, so this is the only way I know to resolve it, even though it will increase administrative overhead until the job is done. Was thinking I might could script it with a "if $USER $SHELL == /bin/tcsh then do timeout".

7 Comments
2015/07/14
17:56 UTC

28

read markdown files like man pages

add this in your shell aliases:

# read markdown files like manpages
mdman() {
    grep -v "\-\-\-\-\-" "$*" | pandoc -s -f markdown -t man | groff -T utf8 -man | less
}

then use it like:

mdman ~/file.md
2 Comments
2015/06/03
21:24 UTC

12

[most shells] Quickly unmount the last device you mounted

I usually save keystrokes by typing:

u!mo

In the rare case you used another command starting with 'mo' after the mount, use progressively longer fractions of 'mount' after the ! to disambiguate. Works in [t]csh and [ba]sh.

9 Comments
2015/05/09
15:23 UTC

12

TIL in bash scripts IFS=$'\n'

Without:

for x in $(echo "/tmp/wee1 2.csv"); do
    echo $x
done

/tmp/wee1

2.csv

With:

IFS=$'\n'; for x in $(echo "/tmp/wee1 2.csv"); do
    echo $x
done

/tmp/wee1 2.csv

From the docs:

$IFS

internal field separator

This variable determines how Bash recognizes fields, or word boundaries, when it interprets character strings.

$IFS defaults to whitespace (space, tab, and newline), but may be changed, for example, to parse a comma-separated data file. Note that $* uses the first character held in $IFS.

5 Comments
2015/03/06
22:47 UTC

5

Quick set operations

If you have two lists of strings (for example, file names) and you want to get strings that are present in the first list, but not in the second, a quick way to do it is:

cat list1 list2 list2 | sort | uniq -u

Other set operations are possible by duplicating another list contents and/or using uniq -d.

Of course, it is more correct and efficient to use comm(1), but the suggested way doesn't require lists to be pre-sorted and allows processing of pipeline and command outputs without need of intermediate files.

0 Comments
2015/02/26
07:03 UTC

8

grep . /files/you/want/*

Simple but effective way to cat a bunch of files with the filename: before each line.

Handy if you want to have a look at a few smaller files at once. Also, it squeezes out empty lines.

8 Comments
2015/02/22
07:54 UTC

2

Sidebar additions request [tools]

Would it be ok to add /r/awk and /r/sed to the sidebar? I didn't create them; I just think they're related/similar enough to link. :-)

3 Comments
2015/02/18
02:05 UTC

29

Github's collection of dotfiles repos & tutorials

I'm one of the maintainers, so I'm a bit biased, but I think that the collection of dotfiles repositories & tutorials at https://dotfiles.github.io/ is a pretty good starting point.

6 Comments
2015/02/16
02:18 UTC

Back To Top