Page 4 of 4 FirstFirst ... 234
Results 31 to 35 of 35

Thread: Two really useful commandline tricks...

  1. #31
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,079
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Two really useful commandline tricks...

    slug slug [sorry it was Coldraven] you have answered my previous question here



    obviously in my new install i had forgotten to add this



    Code:
    sudo gedit  ~/.inputrc
    then copy

    Code:
    "\e[A": history-search-backward
    "\e[B": history-search-forward
    "\e[C": forward-char
    "\e[D": backward-char
    in the document and save


    bingo! amazing functionality is back

    Code:
    ti
    and hitting the upward arrow

    now gives me all my timidity entries again

    so thank you and thanx to the guy who designed this
    Last edited by shantiq; April 18th, 2012 at 05:34 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  2. #32
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,514
    Distro
    Ubuntu

    Re: Two really useful commandline tricks...

    Quote Originally Posted by shantiq View Post
    slug slug you have answered my previous question here



    obviously in my new install i had forgotten to add this



    Code:
    sudo gedit  ~/.inputrc
    then copy

    Code:
    "\e[A": history-search-backward
    "\e[B": history-search-forward
    "\e[C": forward-char
    "\e[D": backward-char
    in the document and save


    bingo! amazing functionality is back

    Code:
    ti
    and hitting the upward arrow

    now gives me all my timidity entries again

    so thank you and thanx to the guy who designed this


    was coldraven that posted

  3. #33
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,079
    Distro
    Ubuntu 16.04 Xenial Xerus

    remove gaps in a filename

    remove gaps in a filename[s] for "_" or for "nogap" or for "." or for ◄► or for a nice Tao sign



    for one filename


    Code:
    rename 's/\ * /_/g'   "my fil e   name.extension"


    bulk:




    ================================================== =============================


    first cd to folder then ::

    Code:
    for f in *; 
    do rename 's/\ * /_/g'   "$f"  "${f%.*}.*" ;done
    Code:
    for f in *; 
    do rename 's/\ * //g'   "$f"  "${f%.*}.*" ;done
    Code:
    for f in *; 
    do rename 's/\ * /./g'   "$f"  "${f%.*}.*" ;done
    Code:
    for f in *; 
    do rename 's/\ * /◄►/g'   "$f"  "${f%.*}.*" ;done
    Code:
    for f in *; 
    do rename 's/\ * /☯/g'   "$f"  "${f%.*}.*" ;done

    or for any symbol which amuses you:

    ♥ ☚ ☛ ☎ ☂ ✪ ✭ ✟ ☮ ☯ ☥ ☪
    Last edited by shantiq; September 4th, 2012 at 12:31 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  4. #34
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,079
    Distro
    Ubuntu 16.04 Xenial Xerus

    2 asterisks to find a folder

    now this one here is a recent favorite when one wants to cd to a folder which has a long name with gaps



    can be a pain to trace and to get it right and you have to add "" marks to make it works



    but there is a really easy way


    find a section in the folder name which is unique to that long name in the directory and simply place inside 2 asterisks


    see example here:


    cd Desktop/*alla*
    shantiq@shantiq-00000000000000000000000:~/Desktop/Rozalla Look_No_Further [1995]

    or say

    cd /home/shantiq/other/*inda*
    shantiq@shantiq-00000000000000000000000:~/other/Hinda Hicks (2004) Still Doin' My Thing#1$


    and voila .... this has really simplified my life at the terminal
    Last edited by shantiq; January 26th, 2013 at 11:15 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  5. #35
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,079
    Distro
    Ubuntu 16.04 Xenial Xerus

    useful commandline tricks to find files and bash commands

    say you want to find a command you used previously and you remember one specific word in that command





    Code:
    history | grep wordyouwant
    and then
    Code:
    !numberyoufound
    to use again


    use in the same way to simply find any file which has a name you want anywhere on your computer; handy when you 'lose' files




    Code:
    find|grep nameyouwant
    or if you want case-insensitive
    Code:
    find|grep -i nameyouwant
    =======================

    also

    to remove all bash history permanently [omit w in command if you want this just for current session]


    Code:
    history -cw

    to remove one line from your bash history same principle [say line 345]


    Code:
    history -d 345
    then
    Code:
    history -w
    Last edited by shantiq; April 13th, 2013 at 12:54 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

Page 4 of 4 FirstFirst ... 234

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •