Skip to content

Utilities

Very handy tool to view the log files for 3 reasons,

  • It mixes the files in the given directory on time stamps, latest last
  • It has tail -f functionality by default
  • You don't have to run it as root.

It also has coloring but that does not add that much.

Usage :

lnav
1
2
3
lnav                  # just dumps syslog
lnav /var/log         # mixes all files in /var/log
lnav /var/log/apache2 # same for apache

nmap

To find out the hard way to see what servers are running in a network segment you can do :

nmap
nmap -v -sP 10.10.0.0/16 > dump

... And get a cup of coffee...

passwords

A password generator

This entry is just here because i keep forgetting the name. Usage :

apg
apt-get install apg
apg

It generates password that are strong BUT rememberable. Example :

output
Vasoopchieb1 (Vas-oop-chieb-ONE)
Lixidcost9 (Lix-id-cost-NINE)

pwgen

Easy generator for password that are easy to remember for humans. apt-get install pwgen pwgen Some tweaking can be done , for instance longer passwords and rules about numbers and capitals. The default is 8 characters but you could make : pwgen -0 -A 20 For passwords with no numbers and no capitals, 20 characters long :

pwqgen

Even better : apt-get install passwdqc pwqgen You will get passwords like : bump4Ordeal=Trial Sneak$male=Other And my all time favourite : invent2lick_Neatly For overall safety, i ran this through howsecureismypassword.

  • pwgen standard, 8 digits (iequ1Zee) gives 15 hours protection
  • pwgen 10 , 10 digits (fai7aquieV) gives 6 years protection
  • pwqgen, 18 digits (Fuzzy4venice_pierce) : 5 quintillion years

So this all depends on how lazy you are, or how frustrated you get when you mistype a password. For this i did a test on weather backspace work within a password entry :

  • ssh : yes
  • main login screen linux : untried yet
  • windows : untried yet

ink

ink
ink -p usb -n 0
ink
1
2
3
4
5
6
ink 0.5.2 (c) 2015 Markus Heinz

HP Deskjet 9800

Black:                                   0%
Color:                                   0%

Ok not helpful but it works. And the other printer :

ink
14:56 $ ink -p usb -n 1
output
1
2
3
4
5
6
7
8
ink 0.5.2 (c) 2015 Markus Heinz

EPSON Stylus Photo RX420

Cyan:                                  100%
Magenta:                               100%
Yellow:                                100%
Photoblack:                            100%

text utils

Find

find is a useful unix command which i usually use in combination with grep

find
find . | grep "class"

But it can also be used directly as in :

find
find . -name "*.class"

Though this is more typing it can be useful when you use the exec option for find. The next command for instance will recursively remove all class files from a java tree :

exec
find . -name "*.class"  -exec rm '{}' ;

For an alternative to this with a more rememberable syntax, see xargs below.

Xargs

xargs is a nice way to turn output of other commands into executable commands. So you can for instance put the output of find trough xargs and execute a command for all names that find has found. An example is the removal of all .svn directories in a source tree.

xargs
find ./ -name ".svn" | xargs rm -Rf

If you are afraid of using it, this version would first print all files.

xargs
find ./ -name ".svn" | xargs echo

But not always the argument appears as the last item on the line, you can steer this with the -I option

arguments
head -1 passwd.mig | cut -d":" -f1 | xargs -I {} grep -l {} /etc/passwd

I use {} here because it corresponds with the find -exec syntax, but this would work just the same :

arguments
head -1 passwd.mig | cut -d":" -f1 | xargs -I x grep -l x /etc/passwd

when using vim, you might get into problem with the tty handling. This will work but not quite perfect.

find
1
2
3
grep -rl "something" . | xargs vim
# messed up tty and you will have to blindly type :
stty sane

don't use xargs with vim, but use : vim $(find -name 'x')

Note that -l means only print the file and stop after the first match, ideal for editing the search result.

Without an explanation, or see if you understand this : https://superuser.com/questions/336016/invoking-vi-through-find-xargs-breaks-my-terminal-why

Use the -o option :

works but vim $() works better
grep -rl "something" . | xargs -o vim

The -o option is non standard, if absent or always use vim $(find -name 'x')

This is the easiest way to edit a list of find results:

vim version
find -name '*.cmake' # check what will be edited
vim $(find -name '*.cmake') # then use :n to walk through them

grep

Some option you might want to permanently add to your search line :

grep
grep -sIr something . 
  • -s : be silent about files that cannot be opened like access rights
  • -I : do not include binary files
  • -r : recursive search

unrar

Simple tip: do not install unrar-free, it does not work : apt-get install unrar

Ctags

typescript ctags

This .ctags file should be able to generate a tags file for typescript :

.ctags
-langdef=typescript
--langmap=typescript:.ts.tsx
--regex-typescript=/^[ t]*(export[ t]+([a-z]+[ t]+)?)?class[ t]+([a-zA-Z0-9_$]+)/3/c,classes/
--regex-typescript=/^[ t]*(declare[ t]+)?namespace[ t]+([a-zA-Z0-9_$]+)/2/c,modules/
--regex-typescript=/^[ t]*(export[ t]+)?module[ t]+([a-zA-Z0-9_$]+)/2/n,modules/
--regex-typescript=/^[ t]*(export[ t]+)?(default[ t]+)?(async[ t]+)?function(*)?[ t]+([a-zA-Z0-9_$]+)/5/f,functions/
--regex-typescript=/^[ t]*export[ t]+(var|let|const)[ t]+([a-zA-Z0-9_$]+)/2/v,variables/
--regex-typescript=/^[ t]*(var|let|const)[ t]+([a-zA-Z0-9_$]+)[ t]*=[ t]*function[ t]*[*]?[ t]*()/2/v,varlambdas/
--regex-typescript=/^[ t]*(export[ t]+)?(public|protected|private)[ t]+(static[ t]+)?(abstract[ t]+)?(((get|set|readonly)[ t]+)|(async[ t]+[*]*[ t]*))?([a-zA-Z1-9_$]+)/9/m,members/
--regex-typescript=/^[ t]*(export[ t]+)?interface[ t]+([a-zA-Z0-9_$]+)/2/i,interfaces/
--regex-typescript=/^[ t]*(export[ t]+)?type[ t]+([a-zA-Z0-9_$]+)/2/t,types/
--regex-typescript=/^[ t]*(export[ t]+)?enum[ t]+([a-zA-Z0-9_$]+)/2/e,enums/
--regex-typescript=/^[ t]*import[ t]+([a-zA-Z0-9_$]+)/1/I,imports/

It does work well indeed but it does not handle local member functions only public private and protected ones. A small alteration in the next line fixes that :

fix
--regex-typescript=/^[ t]*(export[ t]+)?(public|protected|private)?[ t]+(static[ t]+)?(abstract[ t]+)?(((get|set|readonly)[ t]+)|(async[ t]+[*]*[ t]*))?([a-zA-Z1-9_$]+)/9/m,members/

This is a regular expression that recognizes a member function. :

member functions
1
2
3
4
5
6
7
/^[ t]*            -- start of a line followed by any amount of whitespace
(export[ t]+)?     -- optional export followed by at least some whitespace
(public|protected|private)  -- one of these keywords
# changed that one into 
(public|protected|private)? -- one of these keywords optional !

# etcetera

This version gives far more lines in the tag file than before.

java ctags

Ctags can be used for java, with one problem, that it uses dot notation which you want to be resolved as well. If you use ctags normally : ctags -R src You get entries like :

java
!_TAG_FILE_FORMAT   2   /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED   1   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME  Exuberant Ctags //
!_TAG_PROGRAM_URL   http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION   5.8 //
ADMIN   src/com/deal/planner/shared/bean/Perspective.java   /^  COORDINATOR, RECIPIENT, SENDER, ADMIN, DRIVER$/;"   e   enum:Perspective    file:
ANDMap  src/com/deal/planner/server/map/ANDMap.java /^public class ANDMap implements Map {$/;"  c
ANDMapOutput    src/com/deal/planner/server/map/ANDMapOutput.java   /^  public ANDMapOutput(){$/;"  m   class:ANDMapOutput
ANDMapOutput    src/com/deal/planner/server/map/ANDMapOutput.java   /^public class ANDMapOutput {$/;"   c
ANDMapStatus    src/com/deal/planner/server/map/ANDMapStatus.java   /^  public ANDMapStatus(){$/;"  m   class:ANDMapStatus
ANDMapStatus    src/com/deal/planner/server/map/ANDMapStatus.java   /^public class ANDMapStatus {$/;"   c
....
getJSON src/com/deal/planner/server/map/ANDMap.java /^  private ANDMapOutput getJSON(String url, String param) {$/;"    m   class:ANDMap    file:
getJSON src/com/deal/planner/server/map/XMap.java   /^  private XMapOutput getJSON(String url, String param) {$/;"  m   class:XMap  file:

But if you use the special flag : ctags -R --extra=+q src/ It looks like :

java
!_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME  Exuberant Ctags //
!_TAG_PROGRAM_URL   http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION   5.8 //
ADMIN   src/com/deal/planner/shared/bean/Perspective.java   /^  COORDINATOR, RECIPIENT, SENDER, ADMIN, DRIVER$/;"   e   enum:Perspective    file:
ANDMap  src/com/deal/planner/server/map/ANDMap.java /^public class ANDMap implements Map {$/;"  c
ANDMap.getDistance  src/com/deal/planner/server/map/ANDMap.java /^  public long getDistance(Address from, Address to) {$/;" m   class:ANDMap
ANDMap.getDistance  src/com/deal/planner/server/map/ANDMap.java /^  public long getDistance(Location from, Location to) {$/;"   m   class:ANDMap
ANDMap.getJSON  src/com/deal/planner/server/map/ANDMap.java /^  private ANDMapOutput getJSON(String url, String param) {$/;"    m   class:ANDMap    file:
XMap.getDistance    src/com/deal/planner/server/map/XMap.java   /^  public long getDistance(Location from, Location to) {$/;"   m   class:XMap
XMap.getJSON    src/com/deal/planner/server/map/XMap.java   /^  private XMapOutput getJSON(String url, String param) {$/;"  m   class:XMap  file:

You can now use (in vim) :tag XMap.getDistance In the plain ctags file you would always go to the first 'getDistance' encountered. However, it is kind of annoying in normal search mode.

To use the tags file in a directory tree like java usually is structured as, you can use this setting in ~/.vimrc

zoom out upto root
set tags=tags;/

It means look for the file tags in the current directory and than upwards upto root '/'. The ; us the separator. So you could also let it stop in your home directory :

zoom out upto ~
set tags=tags;~

tree

For dumping a directory tree :

install
apt-get install tree
tree

I have had a problem where tree does not show unicode characters : This occurs when you have the LANG environment variable wrong :

correct characters
export LANG=en_US.UTF-8 
tree

Will produce :

output
1
2
3
4
5
6
7
8
9
.
├── __init__.py
├── __init__.pyc
├── settings.py
├── settings.pyc
├── urls.py
├── urls.pyc
├── wsgi.py
└── wsgi.pyc
without
1
2
3
4
5
6
7
8
9
.
|-- __init__.py
|-- __init__.pyc
|-- settings.py
|-- settings.pyc
|-- urls.py
|-- urls.pyc
|-- wsgi.py
`-- wsgi.pyc

Utf8 is most probably a wrong code, I changed it for user kees Dec 2013. There is discussion that utf8 is used only where a dash (-) is not allowed. But the standard definitely seems to be UTF-8 (capitols AND dash).

ant

Here is a section for ant to run ctags :

build.xml
1
2
3
4
5
6
7
8
9
<target name="tags"
  description="Create a tags file for vim">
   <exec executable="ctags">
   <arg value="-R"/>
   <arg value="--extra=+q"/>
   <arg value="--language-force=java"/>
   <arg value="."/>
 </exec>
</target>

Vim

syntax

Dart is not yet supported in vim, here is how to install with pathogen.

dart
1
2
3
4
5
6
7
apt-get install vim-pathogen
mkdir ~/.vim/autoload
mkdir ~/.vim/bundle
cd ~/.vim/autoload
wget https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
cd ~/.vim/bundle
git clone git://github.com/bartlomiejdanek/vim-dart.git

Add this to the top of ~/.vimrc

~/.vimrc
1
2
3
4
execute pathogen#infect()

filetype plugin indent on
syntax on

Should work now.

auto indent

forget about toggling the various indent methods, use ':set paste' instead.

This is mostly a helpful option, but when you want to paste some text into vim it become a real pain. I used to disable auto indent with something like :

~/.vimrc
:set noai nosi nocindent

For no auto indent no smart indent and no c indent And reset everything again after pasting.Not only is that a lot of typing, it does not seem to work anymore. Especially with comments, if you paste after a commented line, everything you paste becomes commented. This does work and is shorter.

~/.vimrc
:set paste

And afterwards

~/.vimrc
:set nopaste

file type indentation

If you are just annoyed with the indentation rules of one type of file, say .rst files, you only need to create a file called ~/.vim/indent/rst.vim with the following content:

~/.vimrc
let b:did_indent = 1

Files ending in .rst will now no longer indent. Rst indentation is particularly annoying because it indents bullet lists etc.

completely disable auto indent

If you really don't want indenting at all.. you can disable filetype based indentation by checking this setting in ~/.vimrc (or a local vim file) :

~/.vimrc
1
2
3
filetype indent plugin on
" or
filetype indent on

Yes .. filetype autoindent is off by default, so you should disable these lines. But if you are using InstantRst (see elsewhere in this page), at least the filetype plugin needs to be enabled, so find the entry where InstantRst is installed with vundle, and just remove the indent from this line :

~/.vimrc
1
2
3
4
filetype indent plugin on    " required
" make it :
filetype plugin on    " required
set paste

gvim

Related to the previous issue, it seems gvim does not read all settings from .vimrc. To get the horrible autoindentation to stop i added set paste at the end of my .vimrc file, and gvim just blatantly ignores it while it does take other settings like the color scheme !?!? For this the solution is rather simple : create a ~/.gvimrc file and put the option there :

~/.vimrc
set paste

If you run the command :scriptnames you get the list of scripts that gvim reads on startup. .vimrc is a lot earlier than .gvimrc so my guess is one of the plugins in between does the damages, and my guess is this one :

~/.vimrc
1
2
3
4
5
3: ~/.vimrc
...
11: /usr/share/vim/vim81/autoload/paste.vim
...
31: ~/.gvimrc

digraphs

For instance to input a euro sign. Vim digraphs are a short way of inserting special characters. Just hit CTRL-k and then 2 keys. Those two keys usually make 'sense' to construct certain characters, like :

~/.vimrc
1
2
3
4
ctrl-k =e becomes €
ctrl-k e` becomes è
ctrl-k a- becomes ā
ctrl-k o: becomes ö

You get the idea, but some are not that easily constructed so type :help digraphs for a complete list. Beware that both xterm and rxvt do not show all characters correctly, a view at :help digraphs is handy to see which are. The "Gnome Terminal" program does show a lot (all ?) characters. Some more handy ones :

~/.vimrc
1
2
3
RT √
34 ¾
=> ⇒

These could also be entered with CTRL-V +

spelling

Yes, works perfectly :

Set the Language in your .vim.custom file or ~/.vimrc like this:

~/.vimrc
set spell spelllang=en_us
set bg=dark

The bg=dark is in case you can't read the highlighting. Now you can see which words are wrong :

  • red highlight: misspelled
  • blue highlight: capitalized wrong.
  • orange highlight: rare words

Standing on a highlighted word you have a couple of two letter commands, starting with z:

  • zg: add the word to the word list : ~/.vim/spell/en.utf-8.add
  • z=: display an alternatives list, you can choose by number which one
  • ]s and [s to search forward and backward for spelling cases.

Ideal for preparing for a sphinx spell check.

eclipse

getting a stack trace on every exception

On the breakpoints tab (in debug view), you see a button called "J!", this is where you can enter breakpoints for events. You have to add all exceptions you wish to catch, so I took the most general one "Exception" and added that. Untested ... Yet, had no exceptions... Yet ;)

Xapian omega

This is a tool for searching a local site, the search bar on this site uses it. Installation is straightforward :

install
apt-get install xapian-omega

The executable will directly be placed in a /usr/lib/cgi-bin/omega and usable on your site. However you will first have to create your database first. I only got it to work in the directory /var/lib/xapian-omega/data/default for some reason. And the 'default' part did not exist so :

prepare
1
2
3
sudo mkdir /var/lib/xapian-omega/data/default
sudo chmod -R 644 /var/lib/xapian-omega/data/default
sudo omindex --db /var/lib/xapian-omega/data/default --url /klopt.web /var/www/klopt.web

Yes.. I only got this all working as root, sorry. omindex generates the index database in the given --db path. The first part of --url is the relative path you would use on your website, the second is a physical directory on the system where the files are. Most probably you need to alter the file /etc/omega.conf to point to the correct directories. Test it from the command line :

test
/usr/lib/cgi-bin/omega/omega

It will prompt for a search term, so on this site "network" would give some result. The output will be html, but if there is an error it will show clearly. If it works, try it as a cgi-bin program. "http://localhost/cgi-bin/omega/omega" The documentation says to put the omega.conf file into /usr/lib/cgi-bin/omega, but it seems to work fine with the file in /etc only.

Visual C++

This is mainly about visual studio 2008. Currently needed for programming windows mobile 5.0 / 6.5.

getting F4 to work

I used to have F4 go to the next error after compilation, but that failed. You can however restore the (correct) setting by choosing :

F4
Tools -> options -> keyboard -> Apply the following additional keyboard mapping scheme -> visual c++ 6 

Now remember Microsoft ... Do it right the first time or DO NOT CHANGE .

no printf output in the console

Or the "output" window of visual C++. It seems the 2003 pocket pc version does not send the output of printf there, but the 2005 version '''does''' You can see when you switch the platform (at the top of the properties page) you get another emulator as well. So take the mobile 5.0 pocket pc version or higher !!

alternative

Or.. If you need the smart phone version you might try opening the serial console because I saw that my printf()'s went to that window as well (untried on smart phone emulator)

  • emulator config file -> configure ->peripherals tab -> enable "create console window for serial port 1"

smartphone vs pocketpc

Actually let's take all Microsoft's flavors :

  • SmartPhone : a phone with some extras , usually no touchscreen
  • Pocket PC : a PDA with no phone, and WITH a touchscreen
  • Pocket PC Phone Edition : a pocket pc with phone functionality built into it
  • Portable Media Center : basically a portable music and video player

The HC700 is not a phone and it has a stylus/touchscreen so it must be a pocketpc.

aptitude

Know when to use apt-get and when to use aptitude. For searching it would recommend aptitude, because it also supports wildcards (perl-style regular expression). For instance when searching python modules, you will be clicking next a lot if you search on 'python' when looking for a module. Try instead, if you for instance look for a module with gl in it for :

aptitude
python-.*gl.*

Though gl is a very noisy term, the choices are reduced to about 30. Which you can scan for the one you search for easily.

when not to use

Those instances where you want to uninstall one item and aptitude attempts to wipe the complete gnome installation. It is because that item was part of a meta-package. In those cases : quit aptitude and use apt-get, it will be more surgical and after that aptitude will behave again as well.

: NEVER, hit g g in a row in aptitude !!, there is no way of stopping it destroying your system. Hit g : THEN EXAMINE

Searching the package descriptions

Normally, when you hit '/' in the interface you search term will only apply to the package titles. If you want to search the package descriptions as well, type ~d before the search term, for instance : ~d VRP (did not find anything ;)

swap space and utility

Mostly i needed this for osrm network generation, you don't want to use swap at all but if needed i like to see what is going on. Perfect way to view both the swap space and what is used is this command :

/proc/swaps
watch cat /proc/swaps

It neatly updates what is going on with lines like this :

output
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       5242580 3786684 -1

You will see the swap climbing and when it reaches size, it will probably give an error like this :

warning
[warn] [exception] std::bad_alloc

Enlarging swap is an option, but more memory is always preferred. However if you don't have memory you could try it with a swap file :

fallocate
1
2
3
4
fallocate -l 100G /path/to/swapfile
chmod 600 /path/to/swapfile
mkswap /path/to/swapfile
swapon /path/to/swapfile

This can actually be done while the generation is still going, your watch command will just show the new space without blinking. Cool...

wipefs

Whenever you get an IO error on startup about a disk partition table that cannot be recognized, it is usually a disk previously used as ZFS disk. Linux will keep bothering you about this if you don't wipe the strings in the partition table.

Do not use wipefs -a -f /def/sdX, it will also wipe the partitioning data.

And if you already done it, look at the testdisk section below. If you are going to re-partition anyhow the command -a -f may be your fastest option.

wipefs
wipefs /dev/sda

Will print only the first offset at which some data is found, it looks something like this :

offset type
0x1fe dos [partition table]
0x23000 zfs_member [raid]
LABEL: bigsafe
UUID: 140029292226195743

Clearly this is a zfs member and if you really want to reuse it as a normal disk linux will complain about the data at offset 0x23000. You can surgically remove it with this command (-f is needed if it is mounted)

wipefs
wipefs -f -o 0x23000 /dev/sda

But if you than run wipefs without options again you will find there is another offset, and another etc. There are probably 20 of these. You can erase them all (-a) but that would take out the partition table as well (trust me.. i tried).

testdisk

If you did fuck up the partition table in the previous chapter, you might recover it with this tool.

testdisk
testdisk

It will ask you some questions, which are probably obvious to answer:

  • log file : sure why not : [create]
  • choose which disk you want to recover
  • partition table type : [Intel]

The hit [ Analyze ] ... and prey... If it finds the boundaries back, you just hit [ write ] and in my case i had my disk drive back again !!

blkid

To prevent fstab from failing when you swap disks around, or add new ones, you probably should not use drive letters but UUID in /etc/fstab.

/etc/fstab
/dev/sdc    /media/heok   ext4    defaults,rw     0       0

This leads to a recovery prompt when you /dev/sda is not the disk you meant. It should be something like this :

/etc/fstab
UUID=2956cd13-4956-4114-89a8-335914254cce /media/heok   ext4    defaults,rw     0       0

However, how to get this UUID, you can find that all by listing /dev/disk/by-uuid

tree
tree /dev/disk/

/dev/disk/
├── by-id
│   ├── ata-Hitachi_HDP725032GLA360_GEA434RF1LP2GG -> ../../sdc
│   ├── ata-Hitachi_HDP725032GLA360_GEA434RF1LP2GG-part1 -> ../../sdc1
│   ├── ata-Hitachi_HDP725032GLA360_GEA434RF1LP2GG-part2 -> ../../sdc2
│   ├── ata-SAMSUNG_HD154UI_S1XWJ1BZ121934 -> ../../sdd
│   ├── ata-SAMSUNG_HD154UI_S1XWJ1BZ121934-part1 -> ../../sdd1
│   ├── ata-SAMSUNG_HD322HJ_S17AJ90Q409427 -> ../../sdf
│   ├── ata-SAMSUNG_HD322HJ_S17AJ90Q409427-part1 -> ../../sdf1
│   ├── ata-SAMSUNG_HD322HJ_S17AJ90Q409427-part2 -> ../../sdf2
│   ├── ata-SAMSUNG_HD322HJ_S17AJ90Q409427-part5 -> ../../sdf5
│   ├── ata-SAMSUNG_HD501LJ_S0MUJ1MQ203352 -> ../../sde
│   ├── ata-SAMSUNG_HD502IJ_S13TJDWQ351998 -> ../../sdb
│   ├── ata-SAMSUNG_HD502IJ_S13TJDWQ543452 -> ../../sda
│   ├── usb-Brother_MFC-J4620DW_BROL5F191329-0:0 -> ../../sdh
│   ├── usb-General_USB_Flash_Disk_1123400000005BB3-0:0 -> ../../sdg
│   ├── wwn-0x50000f0003454325 -> ../../sda
│   ├── wwn-0x50000f0003539189 -> ../../sdb
│   ├── wwn-0x50000f000b044972 -> ../../sdf
│   ├── wwn-0x50000f000b044972-part1 -> ../../sdf1
│   ├── wwn-0x50000f000b044972-part2 -> ../../sdf2
│   ├── wwn-0x50000f000b044972-part5 -> ../../sdf5
│   ├── wwn-0x50000f001b203352 -> ../../sde
│   ├── wwn-0x5000cca34dd69550 -> ../../sdc
│   ├── wwn-0x5000cca34dd69550-part1 -> ../../sdc1
│   ├── wwn-0x5000cca34dd69550-part2 -> ../../sdc2
│   ├── wwn-0x50024e9002dcc2e3 -> ../../sdd
│   └── wwn-0x50024e9002dcc2e3-part1 -> ../../sdd1
├── by-label
│   └── hoekroot -> ../../sdc1
├── by-path
│   ├── pci-0000:00:13.2-usb-0:2:1.0-scsi-0:0:0:0 -> ../../sdg
│   └── pci-0000:02:00.0-usb-0:1.2.4:1.3-scsi-0:0:0:0 -> ../../sdh
└── by-uuid
    ├── 2956cd13-4956-4114-89a8-335914254cce -> ../../sdc1
    ├── 45fc4bd6-aefa-455c-8c70-a3529f862d3b -> ../../sdc2
    ├── 8887696e-cca1-4995-b18f-20c2897cae14 -> ../../sdf5
    ├── 9c5823d8-d930-4577-9eee-d8056faee783 -> ../../sdd1
    └── e330ece6-7c61-4e23-8b52-0e64dc15052d -> ../../sdf1

4 directories, 34 files

Ok.. works, you can see by the link that it should be 2956cd13-4956-4114-89a8-335914254cce, but blkid is probably much handier :

blkid
blkid /dev/sdc1
/dev/sdc1: LABEL="hoekroot" UUID="2956cd13-4956-4114-89a8-335914254cce" TYPE="ext4"