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.
Apart from the many times mentioned Ctrl-R, I like being able to run a command in a subshell by wrapping it in parentheses. Very useful for temporarily setting a shell option. (My thanks to MadeinGermany for teaching me this trick.)
For example, to show long directory listings of all .txt files in or below the current directory.
Starts without add-ons and allows access to more streamed video content from many big-name providers. I just have to watch the commercials, no biggie.
Since changing to Mint Mate 64 from Ubuntu, my system has been so stable I have not needed to learn many terminal commands. I do use package manager in Terminal to repair the inevitable damage done by unapproved "Updates" that manage to sneak past my settings. Downdates if you ask me.
Linux saved my computing life, post windows. Thanks to all who made it happen.
Lots of good stuff here.
Some tricks are so obvious to me by now, I don't perceive them as tricks... like piping in general and to grep in particular... using aliases...
here's something I find very important:
Quote:
Originally Posted by tshikose
I cannot live without the below in my ~root/.bash_profile
have a huge history!
Put that into /etc/bash.bashrc (one of various valid locations under /etc) to be valid for all users!
I also have this in /etc/bash.bashrc:
Code:
alias hf='history|grep'
# (...)
# as big as possible!!!
HISTSIZE=1000000
HISTFILESIZE=2000000
HISTIGNORE='hf *'
# unix.stackexchange.com/a/18443
# history: erase duplicates...
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
______________________
Quote:
Originally Posted by Tux!
alias a=alias
how simple, how useful!
added.
______________________
Quote:
Originally Posted by frankbell
Let me add
Code:
CTRL-r [string]
to search for previous commands.
huh.
i've seen this recommendation dozens of times, but for some reason it clicked only just now.
i'll be using this a lot more from now on. special thanks to frankbell for mentioning it one more time!
______________________
Quote:
Originally Posted by aveatch
One that I use often when I want to dump some text in to a new text file quickly.
cat - > test.txt
enter or paste text
CTRL d when done.
that looks useful.
i'll make it an alias for now, see how it goes.
______________________
Quote:
Originally Posted by sailslack
; play lion.wav
to add a sound (lion.wav) after long command execution.
ctrl-alt-backspace key sequence to auto log off those who forgot to log out when I need to patch. Or just sit -to my userid while they are logged in so I can traverse the network of servers to do my work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.