Some very useful Linux bash functions.

Show a preview of a directory as you cd into it. c() { cd "$@" ls_truncate=20 files=$(ls -F -C –color=always) files_num=$(echo "$files" | wc -l) echo "$files" | head -n $ls_truncate [ $(echo "$files" | wc -l) -gt "$ls_truncate" ] && echo "(Ommited $((files_num-$ls_truncate)) files/directories)" }c() { cd "$@" ls_truncate=20…

Read More

Very cool Linux scripts I have found on the Internet.

A collection of nice Linux scripts I have found on the Internet. Nice pipes terminal screensaver, this is a nice addition to your Linux terminal emulator. https://github.com/pipeseroni/pipes.sh. A collection of very useful MPV user scripts. https://github.com/mpv-player/mpv/wiki/User-Scripts. use Byzanz to capture your Linux desktop to a file for a certain duration….

Read More

Very comprehensive .bashrc file for your Linux system.

Complex .bashrc file for Linux or UNIX Very good and very complex .bashrc file for a Linux or UNIX system. I used this one ages ago and it is great to use. I have tried this on FreeBSD and Open Solaris and it works on either. #!/bin/bash # mode:shell-script #…

Read More

Some more useful Linux commands that are very useful indeed.

Using the Linux last command to view re-boot history. C:\HOME\FLYNN\DOCUMENTS> last reboot reboot system boot 3.4.0-rc2-bejiit Sat Aug 4 12:50 – 14:29 (01:39) reboot system boot 3.4.0-rc2-bejiit Fri Aug 3 21:11 – 21:16 (00:05) reboot system boot 3.4.0-rc2-bejiit Fri Aug 3 20:21 – 20:57 (00:36) reboot system boot 3.4.0-rc2-bejiit Fri…

Read More

Some obscure but very useful Linux commands for any user.

To view the contents of an ISO  image, the isoinfo command for Linux will come in very useful indeed. Just type isoinfo -f -i myiso.iso to view the contents of the ISO image as shown in this example. C:\MEDIA\ELEMENTS\FILES\ISOS> isoinfo -f -i linuxmint-11-gnome-dvd-64bit.iso /BOOT /CASPER /EFI /ISOLINUX /MD5SUM.TXT;1 /PRESEED /_DISK…

Read More

The Linux file-system tree explained.

The Linux file-system tree explained. The standard Linux installation is laid out in various folders that each have a different role to play in the smooth running of a Linux distribution. |-/ |-/bin |-/boot |-/dev |-/etc |-/home/username |-/lib |-/lost+found |-/mnt |-/proc |-/root |-/sbin |-/tmp |-/usr |-/usr/local |-/var|-/ |-/bin |-/boot |-/dev…

Read More

More useful UNIX commands.

Time a UNIX command. the time(1) command will tell you how long it took for a command to execute. ubuntu ~ $ sudo time find / -name dpkg.log /var/log/dpkg.log 0.82user 1.82system 0:34.04elapsed 7%CPU (0avgtext+0avgdata 2260maxresident)k 679328inputs+0outputs (2major+4374minor)pagefaults 0swapsubuntu ~ $ sudo time find / -name dpkg.log /var/log/dpkg.log 0.82user 1.82system 0:34.04elapsed…

Read More