LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-17-2019, 09:27 AM   #61
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,144
Blog Entries: 21

Rep: Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482

Up and down keyboard keys to search for previous command prompts in terminal. Edit. Only good for each session.

Last edited by rokytnji; 05-17-2019 at 09:28 AM.
 
1 members found this post helpful.
Old 05-17-2019, 10:48 AM   #62
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
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.
Code:
(shopt -s globstar; ls -l ./**/*.txt)

Last edited by allend; 05-17-2019 at 11:38 AM.
 
Old 05-17-2019, 10:55 AM   #63
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,146

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
This is something I often find handy
Code:
for file in path/*.odt; do unzip -c $file | grep -iq searchtext && echo $file; done
It searches all Writer documents in the folder path for searchtext and lists those which have it.
 
1 members found this post helpful.
Old 05-17-2019, 11:50 AM   #64
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,731

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by rezadarzi View Post
ctrl + r
i love it
+1 Damn handy, this is.
 
Old 05-17-2019, 11:50 AM   #65
linustalman
LQ Guru
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 12 Bookworm
Posts: 5,731

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Question

Do all of these hotkeys work in all shells?
 
Old 05-17-2019, 12:26 PM   #66
typewar
LQ Newbie
 
Registered: Mar 2019
Distribution: Arch Linux
Posts: 4

Rep: Reputation: Disabled
The shortest command I know:

Code:
> filename
It simply clears a file
 
2 members found this post helpful.
Old 05-17-2019, 01:40 PM   #67
aveatch
LQ Newbie
 
Registered: Dec 2006
Location: Colorado
Distribution: pclinuxos kde, lxqt
Posts: 3

Rep: Reputation: 1
To gain a quick understanding of some shell commands check out:
https://explainshell.com/
For example check:
https://explainshell.com/explain?cmd=ps+aux
 
Old 05-17-2019, 04:31 PM   #68
pmv
Member
 
Registered: Apr 2018
Location: Germany
Distribution: OpenSuSE 15.4 Ubuntu 20.04 Archlinux 2022.08.05 Slackware 15.0
Posts: 87
Blog Entries: 5

Rep: Reputation: 31
1) lynx www.google.de/?q=qdvdauthor
2) history|grep qdvdauthor
3) !848
 
Old 05-18-2019, 01:49 AM   #69
lax luthier
Member
 
Registered: Feb 2017
Location: Santa Barbara Co. Ca
Distribution: Ubuntu 16.04 LTS
Posts: 51

Rep: Reputation: Disabled
firefox -safe-mode

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.
 
Old 05-18-2019, 03:14 AM   #70
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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 View Post
I cannot live without the below in my ~root/.bash_profile
Code:
export HISTTIMEFORMAT='%F %T  '
export HISTSIZE=1000000
export HISTCONTROL=ignoreboth
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! View Post
alias a=alias
how simple, how useful!
added.

______________________

Quote:
Originally Posted by frankbell View Post
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 View Post
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 View Post
; play lion.wav

to add a sound (lion.wav) after long command execution.
i sometimes use this variation:
Code:
some --long --command; espeak "I'm finished!"
______________________________________


But my favorite trick is my terminal-based screensaver. Here's a screencast.
One could also run asciiquarium there
 
1 members found this post helpful.
Old 05-18-2019, 07:18 AM   #71
nypaulie
LQ Newbie
 
Registered: Jun 2016
Posts: 8

Rep: Reputation: Disabled
Thanks sailslack! Never heard of "espeak" until now. What a hoot!
 
Old 05-18-2019, 08:43 AM   #72
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,404

Rep: Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139Reputation: 4139
zshrc change my life
 
Old 05-18-2019, 10:53 PM   #73
gramofenomeno
LQ Newbie
 
Registered: Dec 2005
Location: Bogotá, Colombia, S.A.
Distribution: Mandriva, Slackware, Ubuntu
Posts: 15

Rep: Reputation: 2
du -sm * | sort -nbr

In order to know where which file or directory is filling the filesystem
 
1 members found this post helpful.
Old 05-19-2019, 12:22 PM   #74
Bnkelley43
LQ Newbie
 
Registered: Jan 2018
Posts: 1

Rep: Reputation: Disabled
Wink Favorite terminal trick?

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.
 
Old 05-20-2019, 02:27 AM   #75
LMINTUSER
LQ Newbie
 
Registered: Apr 2019
Posts: 14

Rep: Reputation: Disabled
rm -rf <path to windows's sda drive> lol
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: What is your favorite Linux terminal trick? LXer Syndicated Linux News 0 08-01-2018 12:41 PM
Poll: (Without the poll) - How is Linux used in your workplace? SlowCoder General 13 09-11-2007 11:03 PM
vim :gui trick and undo-trick dazdaz Linux - Software 3 09-10-2007 02:45 PM
Poll: What is your favorite brand of Motherboard? dstrbd1 Linux - Hardware 2 02-16-2006 05:40 PM
Weekly Hardware Poll, Dec 14th: What's your favorite notebook? finegan Linux - Hardware 18 12-03-2004 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration