r/UnixProTips • • Oct 04 '26

Dam

Post image
0 Upvotes

Does anyone know if such rice exists for linux?


r/UnixProTips • • Feb 07 '15

Finished my battery low warning script. Learned about limitations of cron and the difference between lexical and numeric comparisons.

Thumbnail paste.debian.net
0 Upvotes

r/UnixProTips • • Jan 18 '21

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

6 Upvotes

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


r/UnixProTips • • Feb 06 '15

PS aux | grep "keyword"

0 Upvotes

I'm sure you people who have been around for a while know this but, since I am a new convert to Unix/Linux I thought I would share my most useful command since I'm sure I will find more than a few here for myself. I use it to display all processes containing a keyword. If something freezes I use this to find all the pics and then I can use kill -9 to kill them. Much easier than scrolling through top.


r/UnixProTips • • Jul 23 '16

Google translate through the shell doesn't work

2 Upvotes

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)


r/UnixProTips • • Oct 18 '19

Best shell prompt

3 Upvotes

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?


r/UnixProTips • • May 09 '15

[most shells] Quickly unmount the last device you mounted

11 Upvotes

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.


r/UnixProTips • • Feb 08 '15

Alias .~= . ~/.bash_profile

6 Upvotes

Saves a ton of time when you are mucking around with setting environment variables and the like.


r/UnixProTips • • Feb 14 '15

[ZSH] List of ZSH frameworks, plugins & themes

6 Upvotes

I maintain a list of zsh frameworks, plugins, themes and completions at https://github.com/unixorn/awesome-zsh-plugins inspired by the various awesome-* lists.


r/UnixProTips • • Jan 12 '21

Mods needed!

7 Upvotes

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


r/UnixProTips • • Feb 22 '15

grep . /files/you/want/*

9 Upvotes

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.


r/UnixProTips • • Aug 02 '19

Help training newbies

2 Upvotes

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?


r/UnixProTips • • Dec 15 '21

AM, the Application Manager that supports multiple architectures

Thumbnail self.appimage
2 Upvotes

r/UnixProTips • • Feb 04 '15

alias fuck="sudo !!"

42 Upvotes

r/UnixProTips • • Feb 07 '15

Please read before posting.

11 Upvotes

This subreddit is an open place for users of all levels but we need to be mindful of some things that are posted. I'll do my best to illustrate a few guidelines below.

 

  • What is a Unix pro tip? I'm trying to be pretty easy going about this, but it's essentially any command or combination of commands that make using your preferred Unix-like OS easier, interesting, or fun. It's important that you have put some thought into it and it should not run the risk of damaging a users system. Malicious or ill-informed posts will be removed. Again, this is a place for learning and I don't want to be too tough about this. Be mindful of what you post.

 

  • What is not a Unix pro tip? A Unix pro tip is not just simply a command to be run in the shell. Some examples of what is not a Unix pro tip include:

 

Run this command to see processes on your system

ps aux

or

Run this command to get root

su

 

 

Posts with incorrect commands in the title will be removed unless there is sufficient clarification of the correct syntax, in the comments, for it to warrant its presence on the sub. Be thoughtful of other people and the fact that some people may simply run the commands without thinking about them. If you are not sure of the command(s) you are posting then do not post them.

 

Use reddit formatting for your posts, in particular the 4 spaces formatting tip(which can be found by clicking on the 'formatting help' below the submission entry box). It helps to make your posts clear and easier to understand. It's important for subreddits of this nature. Please use it.

 

If your post is specific to a certain Linux distribution, desktop environment , shell etc. please put a tag in the header of your post. Something such as [Debian], [Gnome] or [bash] will do.

 

This post may be updated from time to time so keep an eye on it if you are unsure about the rules of this subreddit. Thanks!


r/UnixProTips • • Feb 05 '15

Use autocd

3 Upvotes

With autocd active, you can "execute" folders by name to do a cd. For example:

L ~/tmp % ..
L ~ % tmp
L ~/tmp % 

I learned to like this after years of using JPSoft's 4DOS and 4NT. I don't know how much time this actually saves me, but it certainly feels like a lot, and that's good enough for me.

To do this in bash:

shopt -s autocd

In zsh:

setopt autocd

Probably best not to do this for root - since if there is an executable on PATH that shares its name with a folder in the current folder, that executable will be run instead. This has yet to cause me any problems, and besides there are few Unix utilities that do anything serious when invoked without options - but best to be safe.


r/UnixProTips • • Mar 06 '15

TIL in bash scripts IFS=$'\n'

12 Upvotes

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.


r/UnixProTips • • Feb 08 '15

Use <<< to treat strings as files Ex: less <<< "Hello Unix!"

Thumbnail linux.die.net
14 Upvotes

r/UnixProTips • • Jan 27 '24

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

Thumbnail
youtube.com
4 Upvotes

r/UnixProTips • • Feb 11 '15

Over 1,000 readers! :-)

19 Upvotes

Wow. Thank you all, I never thought it would reach 500 let alone 1000! Keep posting your tips! Thanks again


r/UnixProTips • • Feb 07 '15

Wait for a process to finish and do something

7 Upvotes

So you want to wait for a process to finish and say, turn off your computer

$ wait 419 && systemctl poweroff
-bash: wait: pid 419 is not a child of this shell

worry not, you can still do it by doing

while [ -e /proc/419 ]; do sleep 60; done && systemctl poweroff

where 419 is the pid of the process you are waiting for.

general usage definition would be

while [ -e /proc/<pid> ]; do sleep 60; done && <command>

which will sleep 60 seconds between checks.


r/UnixProTips • • Mar 25 '20

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

Post image
8 Upvotes

r/UnixProTips • • Sep 14 '22

Linux Guide

9 Upvotes

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.