Jump to content


Today I Learned...

tips tricks shell

  • Please log in to reply
13 replies to this topic

#1 OFFLINE   Fuddster

Fuddster

    Post Master

  • Members
  • PipPipPipPip
  • 142 posts

Posted 24 July 2018 - 09:30 PM

I used the backup software Back In Time to back up my /home folder during my recent openSUSE reinstall. Somehow I missed a setting, I still don't know which one, that allowed BIT to copy/restore more copies of my files with ".backup.fulldate" appended to each file.

OVER 250,000 OF THEM!

I use the find command often, so I opened a terminal and fired it up. To make sure my search pattern worked, I sent the results to a text file and gave it a quick look.

And Today I Learned that the find command has a -delete switch that made getting rid of those files a snap!

The full command went something like
find /home/fuddster/ -name "*.backup.20180721" -delete

Even with commands you use all the time, there's always something else you can learn about them.

What's your favorite AHA! moment like that?
MAXIM 41: "Do you have a backup?" means " I can't fix this."

Posted Image

The Rute Cellar | Fuddster on Twitter

#2 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum Admins
  • 21,517 posts

Posted 25 July 2018 - 12:20 PM

Ah, yes... the command line. It's a wonderful thing. :)

#3 OFFLINE   ebrke

ebrke

    Board Bigwig

  • Forum MVP
  • 2,818 posts

Posted 25 July 2018 - 01:38 PM

Well yesterday I learned the hard way never to assume. I was going to allow openSUSE to recreate my /home, so I copied files to a flash drive before my Leap 15 install. When I went to get my Thunderbird files, I found that .thunderbird and .mozilla had NOT been copied to the flash drive. First I thought I had stupidly not asked to copy hidden files, but I must have because I got .config, .cache, etc., just not what I really needed. Absolutely my own fault for not checking before starting the install, but still really aggravating. I dug around and found a .thunderbird backup that was about a year old, so at least got back most of my address book, but what a pain.
Posted Image

#4 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,167 posts

Posted 25 July 2018 - 10:14 PM

Today I learned that Linux Lite doesn't support UEFI: https://www.linuxlit...and-linux-lite/

I had been testing the latest release, running live sessions from a flash drive, but couldn't boot my two newer notebooks. Found the above link later.

Actually not a bad Xfce distro, overall, from what I'm seeing.

#5 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,167 posts

Posted 26 July 2018 - 12:14 PM

One of my favorite AHA! moments was finding out about using Ctrl+R to do a "reverse-i-search" through the command history.

#6 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,633 posts

Posted 27 July 2018 - 07:47 AM

One of my favorite AHA! moments was when I learnt that you could open a new tab in FF by middle clicking on an open space in the top bar, no more fiddling to hit the little cross.  :Laie_95:

An a similar AHA! moment was when I learnt to copy by holding down the left mouse button and to paste in linux with a middle click. This trick has its down side as when I am in Windows it does not work and confuses the heck out of me poor old grey cell. :228823:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#7 OFFLINE   sunrat

sunrat

    Thread Kahuna

  • Forum Moderators
  • 5,692 posts

Posted 27 July 2018 - 11:58 PM

Some good tips. I usually use exec with find eg.:
find . -name "*.wmv" -type f -exec rm {} \;

And yes I hate it when middle button paste doesn't work in Windows.
registered Linux user number 324659  ||    The importance of Reading The *Fine* Manual! :D
Posted ImagePosted ImagePosted ImagePosted Image
For the things we have to learn before we can do them, we learn by doing them.

#8 OFFLINE   saturnian

saturnian

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,167 posts

Posted 28 July 2018 - 12:33 AM

View Postabarbarian, on 27 July 2018 - 07:47 AM, said:

One of my favorite AHA! moments was when I learnt that you could open a new tab in FF by middle clicking on an open space in the top bar, no more fiddling to hit the little cross.  :Laie_95:


AHA! I use Pale Moon, and this trick works with that browser as well! Thanks, abarbarian!

#9 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,633 posts

Posted 28 July 2018 - 01:44 PM

TIL that educating prisoners may not be a good thing,

364 Idaho Inmates Hacked Their Prison Tablets for Free Credits


:Muahaha: :Laughing:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#10 OFFLINE   Hedon James

Hedon James

    Topic Cop

  • Members
  • PipPipPipPipPipPipPip
  • 868 posts

Posted 29 July 2018 - 09:55 AM

View Postabarbarian, on 28 July 2018 - 01:44 PM, said:

TIL that educating prisoners may not be a good thing,

364 Idaho Inmates Hacked Their Prison Tablets for Free Credits


:Muahaha: :Laughing:

Haha!  I saw that too!  Goes to show that they CAN be "rehabilitated" through teaching of productive and useful skills, but we still can't rehabilitate their brain in order to use those skills for good.

Reminds me of that Stallone/Snipes movie "Demolition Man" where the convicted are frozen in pods, while their brains are re-programmed for societal integration.  Stallone's overzealous cop character is taught knitting (presumably to help with relaxation?) while Snipes' psychopath character learns extensive electronics and computer programming.  What could possibly go wrong with that?

#11 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,633 posts

Posted 29 July 2018 - 11:18 AM

TIL.

Create an alias for sudo with a space at the end:

alias sudo='sudo '

Then all other aliases will work with sudo.

As in

alias   w7=" sudo mount /dev/nvme0n1p3 /mnt"
alias   w7u=" sudo umount /dev/nvme0n1p3"

This allows me to mount and unmount my Windows 7 partition on the rare occasion I need to transfer some files.

:breakfast:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#12 OFFLINE   raymac46

raymac46

    Discussion Deity

  • Forum MVP
  • 3,838 posts

Posted 14 August 2018 - 08:32 AM

If you are editing /etc/fstab, say to configure an SSD you can make a typo or add a space and then completely bork your system boot. To check you have done this edit right issue the following terminal command BEFORE reboot.

$ sudo mount -a

If this works without error you are good to go. If not, fix /etc/fstab and try again until error-free.
Posted Image

Registered Linux User 445659

#13 OFFLINE   Pete!

Pete!

    Message Mogul

  • Members
  • PipPipPipPipPip
  • 291 posts

Posted 14 August 2018 - 10:00 AM

Today I learned (the hard way) ..... synchronizing works both ways.

Just stuck my toe in the "Linux pool" by using "LICK" to do an easy dual boot with Puppy.
Rather than do all the work of setting up the included browser (Palemoon), I installed Firefox, and "synchronized".

Now, back on Windows, all the NoScript "trusted" sites are back in "default" mode, and stuff doesn't work until I put it back. :(

If the only things you want to synchronize are bookmarks and log-ins ...... UNCHECK EVERYTHING ELSE !

#14 OFFLINE   raymac46

raymac46

    Discussion Deity

  • Forum MVP
  • 3,838 posts

Posted 14 August 2018 - 10:27 AM

If you mess up /etc/fstab and are unable to boot to a GUI and fstab is now read-only, you can remount the fs as follows if you can get to a root shell in recovery mode:

mount -n -o remount -t ext4 /dev/sda1 /

You should then be able to use nano (or VIM) to edit your fstab file and get back to where you were before. Note depending on your setup the partition info and file system parameters may differ.

Edited by raymac46, 14 August 2018 - 10:29 AM.

Posted Image

Registered Linux User 445659





Also tagged with one or more of these keywords: tips, tricks, shell

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users