How to read a symbolic link and some text filtering commands.

Getting into some more Linux commands now; if you want to know how to find out what a symbolic link is linking to; you may use the command below to read the symbolic link and find out where it leads.

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 2 ]
[ 21:50:39 ]
[ $ ]-> readlink My\ Downloads
Downloads/

This command will also work…

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 1 ]
[ 22:25:04 ]
[ $ ]-> ls -hula My\ Downloads
lrwxrwxrwx 1 john john 10  29-11-12 09:48 pm My Downloads -> Downloads/

To change text on the fly into something else; then you may use the filtering commands available on Linux.

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 10 ]
[ 22:28:35 ]
[ $ ]-> echo "Hello World" | newspeak
Hello World

Hail Big Brother!

This is another example.

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 8 ]
[ 22:36:12 ]
[ $ ]-> echo "Hello World" | eleet
h3ll0 w0rld

And one final example.

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 13 ]
[ 22:38:47 ]
[ $ ]-> echo "This is your captain speaking" | jive
Dis is yo' captain speakin'

This is how to fold text using the Linux command-line. Using the -w parameter; you can set how many columns wide the text is.

[ [email protected] ]
[ Jobs 0.PWD: ~.bash 4.2.36. ] [ 22 ]
[ 22:42:39 ]
[ $ ]-> echo "Hello World" | fold -w 6
Hello 
World

This is an interesting trick; this tr example changes all instances of am to pm in the ls output.

[ [email protected] ]
[ Jobs 0.PWD: ~/Desktop.bash 4.2.36. ] [ 69 ]
[ 22:56:45 ]
[ $ ]-> ls -hula | tr "am" "pm";
totpl 99M
drwxr-xr-x  2 john john 4.0K  29-11-12 10:22 pm .
drwxr-xr-x 51 john john 4.0K  29-11-12 10:54 pm ..
-rw-r--r--  1 john john  90M  27-11-12 09:59 pm 4chpn Epic Gifs of 2012 PART 1.mp4
lrwxrwxrwx  1 john john    8  29-11-12 10:48 pm blog.htm -> blog.txt
-rw-r--r--  1 john john 1.4K  14-11-12 02:21 pm blog.text
-rw-r--r--  1 john john 3.8K  08-10-12 02:21 pm blog.text~
-rw-r--r--  1 john john 2.8K  29-11-12 10:36 pm blog.txt
-rw-r--r--  1 john john 2.1K  11-10-12 10:31 pm blog.txt~
-rw-r--r--  1 john john 7.3M  05-10-12 04:16 pm cprs_burnout.flv
-rw-r--r--  1 john john  19K  27-11-12 09:59 pm computer.jpg
-rw-r--r--  1 john john 4.4K  20-11-12 08:36 pm Document3.txt
-rw-r--r--  1 john john  256  18-10-12 11:27 pm fizzbuzz.pl
lrwxrwxrwx  1 john john   38  29-11-12 10:48 pm home.desktop -> ../.e/e/filempn/fpvorites/home.desktop
-rw-r--r--  1 john john 293K  29-10-12 11:50 pm IMG-20121008-00046.jpg
-rw-r--r--  1 john john 295K  29-10-12 11:50 pm IMG-20121008-00047.jpg
-rw-r--r--  1 john john 278K  16-10-12 08:41 pm IMG-20121008-00048.jpg
-rw-r--r--  1 john john  315  29-10-12 11:50 pm iostpt.txt
-rw-r--r--  1 john john   70  14-11-12 02:21 pm ls.out
-rw-r--r--  1 john john 9.0K  27-11-12 10:39 pm out3
lrwxrwxrwx  1 john john   38  29-11-12 10:48 pm root.desktop -> ../.e/e/filempn/fpvorites/root.desktop
-rw-r--r--  1 john john 142K  16-10-12 08:41 pm Screenshot - 270812 - 14:41:07.png
-rw-r--r--  1 john john 101K  16-10-12 08:43 pm Screenshot - 310812 - 15:14:30.png
-rw-r--r--  1 john john  95K  08-10-12 02:15 pm Screenshot-wifi-rpdpr.png
lrwxrwxrwx  1 john john   37  29-11-12 10:48 pm tmp.desktop -> ../.e/e/filempn/fpvorites/tmp.desktop
-rw-r--r--  1 john john  331  14-11-12 02:21 pm troubleshooting.text
-rw-r--r--  1 john john 2.2K  14-09-12 11:26 pm userinformption.dip
-rw-r--r--  1 john john 2.1K  29-10-12 11:50 pm userinformption.vbs
-rw-r--r--  1 john john  237  14-11-12 02:21 pm windows2012

There are many examples like this that can be used on the Linux command-line to filter text and modify output to suit your needs; or just for fun as with the text filter examples.

About

I am a computer enthusiast that has always been interested in maintaining and upgrading computer hardware. I was born on a farm and lived there for 13 years before moving into town. I was always interested in technology and my father always gave me good encouragement for developing my knowledge and interest in tinkering with computers. He was using a computer on the farm but that was in the very late 80`s and late 90`s. Seeing what a computer could do always fascinated me and then I knew that is what I wanted to do. The first time I used Linux was Red Hat 6.2 installed off a single CDROM and I was amazed that you did not need to install any more drivers on my old Intel Celeron machine to be able to enjoy a nice 24BPP desktop and use the GIMP to edit photos and enjoy playing the old Linux games like Xbill. Then a while later I tried Mandrake Linux 9.2 and I was hooked. It came with so much software and was very easy to use as well. Then Mandrake Linux 10 and on through FreeBSD, Debian 3.0, Debian 3.1 Suse Linux 9.2, Suse 10 and onto the Ubuntu distributions although I am using Fedora Core 15 and the Gnome 3 desktop at the moment.

Tagged with: , , , ,
Posted in bejiitaswrath

Leave a Reply

Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins