How to add a directory in a mounted filesystem as a directory accessible by your user.

How to mount a partition on Linux and make your old home directory accessible to your user To add a directory in a mounted drive as a folder accessible by a normal user, use this command to change the ownership of all files and directories to that of your current user. [root@darkstar Videos]# chown -R … Read more

How to search for a folder and then switch to it in Linux.

This simple command will search for a folder named xray* and then switch to it. ┌──[[email protected]]─[~/Documents] └──╼ ╼ $ cd $(find . -type d -name "xray*")┌──[[email protected]]─[~/Documents] └──╼ ╼ $ cd $(find . -type d -name "xray*") After running this command, it has found a folder that matches the wildcard and then switched to it. ┌──[[email protected]]─[~/Documents/xray-16] … Read more

How to search through textfiles in a folder when you are stuck on Windows.

Windows has quite a few useful utilities for searching text. The findstr utility allows searching through a folder full of text files for a certain string. Here is an example. >findstr /S /R "money_quest_update" *.*>findstr /S /R "money_quest_update" *.* And this is how to search for text strings in a folder. E:\shadowofchernobyl\gamedata>findstr /S /R "money_quest_update" … Read more

How to set up a file share with Samba on Ubuntu 17.10 and share files to Windows users.

Setting up a file share in Samba is very easy. I am using Ubuntu 17.10. Firstly, install Ubuntu, then install the Samba server. jason@kaio:~$ sudo apt install sambajason@kaio:~$ sudo apt install samba Then create a folder to share from. I made one in the root directory named Share then I added the entries below to … Read more

How to have all files in a directory to all default to the parent permissions.

This command will set all new files in the directory to all default to the permissions set to the parent directory. This is very useful when creating a new directory and you wish to ensure that the files therein have correct permissions. jason@jason-desktop:~$ sudo setfacl -R -d -m o::rwx Documents/ [sudo] password for jason:jason@jason-desktop:~$ sudo … Read more

How to create an ISO image of a directory with the command line.

Creating an ISO image of a directory is useful sometimes. This command will create an ISO image of a directory, ready to burn to a CD or DVD. jason@darknet:~$ genisoimage -l -V hi -r ~/Downloads/stuff > cdrom.isojason@darknet:~$ genisoimage -l -V hi -r ~/Downloads/stuff > cdrom.iso Here is example usage, creating an ISO of a directory … Read more

How to use the Linux cat command to read the contents of a folder. This is a cool trick.

This is a neat trick that allows you to use cat to view the contents of a directory. This library is loaded before the cat command is executed and modifies its behavior to allow you to use cat to list a directory. #include <unistd.h> #include <stdio.h> #include <dirent.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include … Read more