December 30, 2021

Tips for using Apple's File System to its Potential

Apple changed their default file system from their Hierarchical File System (HFS+) to Apple File System (APFS) arround 2016 with the release of MacOS High Sierra. APFS is a modern “copy on write” file system but if you are used to a file system like ZFS it was a bit of a disapointment. The biggest issue most people had was the lack of tools provided by the system for managing and using the features of APFS. Read more

October 13, 2021

A Few Thoughts on Using FreeBSD Packages and Ports

FreeBSD s a complete operating system with a large collection of tools in the base system. FreeBSD also provides two ways for installing third-party software: the FreeBSD Ports Collection, for installing from source, and packages, for installing from pre-built binaries. I am not going to go into how to set up packages or ports, this is well documented at About FreeBSD ports and Installing Applications: Packages and Ports. When you start installing third party applications on FreeBSD you must decide if you will use ports or packages. Read more

May 27, 2021

Examples of using find in Unix like systems

find is one of the Unix utilities that is most often used. As the name says it is used to find something i.e. files. It has many options you can use to specify which files to look for. One of the simplest uses is find . -name somefile that will look for the file named somefile in the current directory. If you use find . -iname somefile a case insensitive search will be done for somefile. Read more

August 25, 2018

Collection of FreeBSD tips

This is a collection of FreeBSD tips that comes with the fortune programe included in the system. Many of these will work on any Unix system. Any user that is a member of the wheel group can use “su -” to simulate a root login. You can add a user to the wheel group by editing /etc/group. By pressing “Scroll Lock” you can use the arrow keys to scroll backwardthrough the console output. Read more

July 12, 2018

Outlook is rubbish!

Microsoft Outlook especially older versions is junk, but you probably knew that already. For some reason Outlook often sends out a message with incorrect syntax e.g. “[email protected]”. Mail servers like postfix will reject these messages but Outlook will not warn its user that there is a problem. Instead it will keep the message in the outbox and continously retry sending. If you are a postfix admin you can strip the apostrophes with a command filter. Read more

October 23, 2017

Change vim 8.0 .vimrc behaviour back to sanity

When a user doesn’t have a /.vimrc file in vim 8.0 (and possibly later) vim loads the default configuration file after the systemwide vimrc file created by the system administrator. This overides any settings the system administrator made. This is of course totally unexpected and frustrating especially when you upgrade from earlier versions. Some may even call it insane and it is definitely not expected behaviour. Anyway below is a way to prevent that from happening. Read more

August 26, 2017

UNIX - Use sed to edit files

sed is one of the commands that have been around forever on Unix systems. sed is a stream editor that you can use to perform basic text transformations on an input stream (a file or input from a pipeline). Want to use sed to edit a file in place? Well, to replace every ’e’ with an ‘o’, in a file named ‘foo’, you can do: sed -i.bak s/e/o/g foo And you’ll get a backup of the original in a file named ‘foo. Read more

August 26, 2017

FREEBSD - Show open sockets

Most people know the netstat command to show you everything about the state of the network on your machine. You can also use sockstat to list all the open sockets on your system. Below are the sockstat options. sockstat -4 Show AF_INET (IPv4) sockets. sockstat -6 Show AF_INET6 (IPv6) sockets. sockstat -c Show connected sockets. sockstat -j jid Show only sockets belonging to the specified jail ID. sockstat -L Only show Internet sockets if the local and foreign addresses are not in the loopback network prefix 127. Read more

August 26, 2017

UNIX - Specify file and disk size output

If you want df, ls or du and other commands to display disk sizes in kilobytes instead of 512 byte blocks, set BLOCKSIZE in your environment to ‘K’. You can also use ‘M’ for Megabytes or ‘G’ for Gigabytes. If you want them to automatically select the best size then use df -h for example.

June 27, 2017

Do you need to find large files?

Use the following command to get a list of files sorted from large to small on your unix machine. du -ak |sort -rn |less This is useful if you want to cleanup your files, or when a disk is filling up.

© Arnold Greyling 2022

Powered by Hugo & Kiss.