LinuxQuestions.org
Help answer threads with 0 replies.
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 10-19-2020, 04:58 AM   #166
Wazza65
LQ Newbie
 
Registered: Oct 2019
Location: Melbourne, Australia
Distribution: Debian 4.19 Buster AMD64
Posts: 3

Rep: Reputation: Disabled

My tips / tricks are basic dumb terminal tricks from around 30 years ago :
1. at night, instead of turning on the lights, I reversed the lighting on the VT100 so it was black on a white background instead of white on a black background.
2. I was getting a headache using a Wyse-50 in a room with North (sun) facing windows (without blinds) because of the brightness. I put on sunglasses (polarising type) and adjusted the screen brightness to compensate, and my headache went away.

That's a general tip : if you get a headache staring at a screen, try wearing sunglasses to cut the screen glare.
It's also part of the reason behind the health reccomendation of a 5 minute break every hour of screen use.
 
1 members found this post helpful.
Old 10-19-2020, 05:05 AM   #167
PloniAlmoni
LQ Newbie
 
Registered: Apr 2020
Posts: 7

Rep: Reputation: Disabled
!$ to repeat the last parameter of the prior command line.

ls /foo/bar
vi !$/baz

can be very useful for a lot of file management commands. Works in Bash and in CSH, don't know if it works in Bourne (as if anyone uses SysV sh(1) in Linux)
 
2 members found this post helpful.
Old 10-19-2020, 05:30 AM   #168
BAD-MF
LQ Newbie
 
Registered: Feb 2020
Location: Stockholm
Distribution: Mostly RPM, love DEB
Posts: 3

Rep: Reputation: Disabled
Thumbs up Check for the status of anything

This is helpful for a lot of things one normally has to wait for, like a DNS registration or even check the status or size of anything. It's a command to check if my expected output is ready or whatever it is.

Code:
watch -n1 "WHATEVER COMMAND I WANT RAN EVERY 1 SECOND"
 
Old 10-19-2020, 08:04 AM   #169
Tux!
Member
 
Registered: May 2011
Location: Netherlands
Distribution: openSUSE
Posts: 114

Rep: Reputation: 32
$ exec tcsh

Yeah, bash is fine, but I started Unix/Linux back in System-III times, when there were only sh and csh. And sh in those days was far from as fonctional as bash is nowadays, so developing in csh made a lot of sense.
Then came ksh, and posix-sh as extended versions for sh and in the same time tcsh to extend csh. Moving from csh to tcsh made a lot more sense than moving from csh to ksh. Not that all of this is from an end-user development working environment, not for system-scripts. csh/tcsh are *not* suited for portable system scripts.

So, where many users have (huge) custom settings for their favorite editor or IDE, many will also make good backups for their favorite shell startup file(s) (.profile, .bashrc, .tcshrc). Having an environment that works on all systems you work on (including old systems like AIX, HP-UX, Solaris and ancient versions of Linux that can not be modernized for dark reasons) my main production-booster command is to replace whatever the current shell on the system is with tcsh (and if I need to revisit the system more often, put .tcshrc in the home folder)

YMMV
 
1 members found this post helpful.
Old 10-19-2020, 08:04 AM   #170
mark.schutte
LQ Newbie
 
Registered: Apr 2020
Posts: 1

Rep: Reputation: Disabled
Smile !$

What's my favorite Linux trick? Not really a trick, but it is my favorite command line short-cut of all time... it's the "!$". Nothing saves more typing that !$. I can't live without it. If you've never heard of it, typing !$ on the command line repeats the last white-space separated <ANYTHING> from your previous command line. I love using !$ whenever the last thing I typed was so super long path or long filename. Why type it again? Simply hit !$. :-)
 
1 members found this post helpful.
Old 10-19-2020, 08:13 AM   #171
Tux!
Member
 
Registered: May 2011
Location: Netherlands
Distribution: openSUSE
Posts: 114

Rep: Reputation: 32
Quote:
Originally Posted by resolv_25 View Post
I think that I've found somewhere basic idea, easy password generator from the shell.
This goes to the ~/.bashrc on the Ubuntu or Debian:
Code:
$ pwgen -nys 16 1
VZ0Kz}zMGZ=\@B@9
pwgen is available on many Linux systems, though not all distributions include it in the default installation.
 
1 members found this post helpful.
Old 10-19-2020, 08:26 AM   #172
PloniAlmoni
LQ Newbie
 
Registered: Apr 2020
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by Tux! View Post
$ exec tcsh

Yeah, bash is fine, but I started Unix/Linux back in System-III times, when there were only sh and csh. And sh in those days was far from as fonctional as bash is nowadays, so developing in csh made a lot of sense.
Then came ksh, and posix-sh as extended versions for sh and in the same time tcsh to extend csh. Moving from csh to tcsh made a lot more sense than moving from csh to ksh. Not that all of this is from an end-user development working environment, not for system-scripts. csh/tcsh are *not* suited for portable system scripts.

So, where many users have (huge) custom settings for their favorite editor or IDE, many will also make good backups for their favorite shell startup file(s) (.profile, .bashrc, .tcshrc). Having an environment that works on all systems you work on (including old systems like AIX, HP-UX, Solaris and ancient versions of Linux that can not be modernized for dark reasons) my main production-booster command is to replace whatever the current shell on the system is with tcsh (and if I need to revisit the system more often, put .tcshrc in the home folder)

YMMV
It was still that way in SysVr2 or r3 that I ran in a shell account before Linux, wasn't until SysVr4 that it got some BSDisms. tcsh is the default shell in FreeBSD I think, or at least the default csh. I'd run FreeBSD on my workstation sometimes except it doesn't support its hardware.
 
Old 10-19-2020, 08:36 AM   #173
resolv_25
Member
 
Registered: Aug 2011
Location: Croatia
Distribution: Debian 10/Ubuntu 20.04
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by Tux! View Post
Code:
$ pwgen -nys 16 1
VZ0Kz}zMGZ=\@B@9
pwgen is available on many Linux systems, though not all distributions include it in the default installation.
Hi, also fine that one, however on Ubuntu and Debian it is not installed by default. Still, quite handy as well.
 
Old 10-19-2020, 08:40 AM   #174
resolv_25
Member
 
Registered: Aug 2011
Location: Croatia
Distribution: Debian 10/Ubuntu 20.04
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by PloniAlmoni View Post
!$ to repeat the last parameter of the prior command line.

ls /foo/bar
vi !$/baz

can be very useful for a lot of file management commands. Works in Bash and in CSH, don't know if it works in Bourne (as if anyone uses SysV sh(1) in Linux)
Another shortcut that I like and getting same effect:
Code:
$ ls /foo/bar
$ alt+.  # printing /foo/bar
Alt+. is repeating the last part of previous command, can be parameter, whatever.
 
4 members found this post helpful.
Old 10-19-2020, 08:48 AM   #175
fraxflax
LQ Newbie
 
Registered: Jan 2018
Location: Sweden
Distribution: Debian
Posts: 23

Rep: Reputation: 5
Talking zsh's compctl

from the mid 90s on, I've every now and then added to my, in .zshrc-sourced, ~/.zsh/completerc file which holds all my compctls.... many times I thought that I'd take the time and rewrite it to function with bash so I don't have to install zsh on every linux-host I login to ... but I'm to lazy to go through this mile-long file now and rewrite it ... it's just such a joy being able to hit tab almost anywhere on the command line and get the alternatives that makes sense for me in that exact position with the combination of commands that are currently typed ....

zsh's compctl is the joy of my terminal life :-D and my completerc-file is the hack of terminal hacks for me ... combined with surrounding functions and prepopulated data ...

e.g. my .zlogin does a 'host -l' of the zones I most frequently refers to hosts in and if it succeeds (I need to come from certain ip addresses to be able to do xfers of some of the zones) saves the hostnames in a file (otherwise it does not touch that file, as it already contains the hostnames from last time it succeeded) which then, via compctl, is used to complete hostnames in a number of commands such as ssh, rsync, etc, etc .... not having to type hostnames or ip addresses being able to simply tab-complete the correct FQDN when the hostname is the same in different domains/zones, etc, etc, is pure *joy* :-D ... being able to tab-complete every aspect of ip (iproute2) having it understand when you need to add a 'dev', listing the host's ifc names for you, etc, etc ... the possibilities are endless and have saved me so much time and effort over the years!

check out zsh's compctl ... or if you are a bash-person bash's 'complete + compopt' commands and tweak how you tab-complete ... it will make you a happier person by the end of the day :-)

Last edited by fraxflax; 10-19-2020 at 09:33 AM.
 
1 members found this post helpful.
Old 10-19-2020, 09:32 AM   #176
clamstrip
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 1
Thumbs up for the tcsh users

I like this!

Quote:
Originally Posted by bigearsbilly View Post
Code:
alias path='(IFS=:;ls -1d $PATH |  nl)'


0:% path
ls: cannot access '/home/billy/R/usr/bin': No such file or directory
ls: cannot access '/home/billy/R/bin': No such file or directory
     1  /bin
     2  /home/billy/bin
     3  /home/billy/go
     4  /home/billy/usr/bin
     5  /sbin
     6  /usr/bin
     7  /usr/games
     8  /usr/local/bin
     9  /usr/local/games
    10  /usr/sbin
so here's the variant

alias path 'ls -1d `echo $PATH | tr ':' "\n"` | nl'
 
1 members found this post helpful.
Old 10-19-2020, 10:42 AM   #177
resuni
Member
 
Registered: Oct 2009
Location: Colorado, USA
Distribution: I use Arch btw
Posts: 142

Rep: Reputation: 12
Ctrl+U clears whatever text you just entered. This also works on password prompts (and also works in the password field on most lock screens I've used).

Most people have probably known about this for a while, but I just discovered it recently. I love it for password prompts because it saves me from hitting backspace an excessive number of times or Ctrl+C-ing out and re-invoking whatever program created the prompt.
 
1 members found this post helpful.
Old 10-19-2020, 05:10 PM   #178
josephpmh
LQ Newbie
 
Registered: Mar 2012
Location: Kensington, MD
Distribution: Linux Mint Cinnamon
Posts: 11

Rep: Reputation: Disabled
Toss-up between ...

rsync & ffmpeg.
 
Old 10-19-2020, 05:37 PM   #179
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Cornwall UK
Distribution: Mint 20 xfce 64bit
Posts: 1,020
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by hydrurga View Post
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.
Bit late in the day but SHIFT-INSERT also pastes into a terminal - SHIFT-DELETE will cut from Text Editor, I usually use these together SHIFT-DELETE - SHIFT-INSERT to put it back and then SHIFT-INSERT to put it where I need in a terminal.
 
Old 10-19-2020, 05:38 PM   #180
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Cornwall UK
Distribution: Mint 20 xfce 64bit
Posts: 1,020
Blog Entries: 3

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by josephpmh View Post
rsync & ffmpeg.
ffmpeg for sure
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:52 AM.

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