LQ Poll: What's your favorite Linux terminal trick?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Didn't know what you are talking about - not installed by default on my system (Xubuntu something something). Does that count as a "trick"? Because if anything you can install counts as a trick...
On the other hand, now that I've installed it's my new favorite thing :-)
Setting up Vim so that line numbers are added when coding, and line numbers are added when printing a hard copy. This is performed as a routine so the number show up anytime a new file is created or an existing file is opened.
I know it's very simple, but it took me a while to realise that I could copy and paste text to/from my terminal by using shift-ctrl-c and shift-ctrl-v.
I'd say for bash and zsh it would be command substitution $(...) and process substitution < <(...) I use the former a lot but have only occasional opportunity to use the latter.
Edit: here's probably my most unusual use of command substitution. It's from an OpenBSD system which would report the battery status in the shell prompt, but only while the machine was unplugged:
I don't know if this counts, but I have cases where I need to use a lot of [[ ]] shell scripting in cron and I'll be timing resource intensive automated scans to run in absence of a particular PID or file which implies another resource heavy tool - so as not to overburden the servers. The "flock" command has been my friend for sure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.