Change owner for directory recursively: sudo chown -R user:group /path/to/directory Chown is a short for “change owner”, -R – means “recursively”, owner and group definition are separated by “:”. Also we need high privileges to run chown command – so we use “sudo”. Change permissions only for directories recursively: find /path/to/directory -type d -exec chmod 755 {}Continue Reading
Tag: Linux
How to run a program as daemon without any output
Each program has a set of file descriptors. It’s like an open stream from / to file. On start program has 3 descriptors: standard input (stdin), standard output (stdout) and standard error (stderr). They has numbers: from 0 to 2. Standard input is used for reading input data from the user (from the terminal). StandardContinue Reading
How to copy from a terminal to the Linux or MacOS system clipboard
When you use a clipboard of your desktop environment (DE), you may think, that it’s some global buffer. But it’s not it works inside DE. For example, come terminal utils use their own buffers – vim has its own buffers for working inside the editor. But we have commands which you can use to copyContinue Reading
How to flush DNS cache in Ubuntu / Debian / Linux Mint
The Domain Name System (DNS) is a hierarchical decentralized naming system. It’s used for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses.Continue Reading
How to show today’s files only in Linux
ls command has many abilities. Mostly we use it to show a list of files in current directory. We can even define style for output. For example ls -al –time-style=+%D – shows to us same ls -la list of files, but time column will be in different format. So, if we grep it by timeContinue Reading
How to make a layer 2 bridge between two or more Ethernet interfaces on Ubuntu Linux
The layer 2 bridging is an implementation of IEEE 802.1 D. This is the transparent bridging that was used in Ethernet layer bridges. Install package: apt-get install bridge-utils Next we’ll create a fake bridge interface: brctl addbr br0brctl stp br0 on # Enable STP in case of network loops Now we can add interfaces toContinue Reading
Wine Runtime Error: Cannot Import dll isskin.dll
On MacOS and Linux we can use Wine (“WIndows not emulator”) to run Windows applications. But it’s not as easy as we can expect – some times we don’t have necessary dynamic libraries, that windows programs use. For example, when I ran one of them, I got Runtime Error (at -1:0): Cannot Import dll:C:usersuserTempis-VADAE.tmpisskin.dll OrContinue Reading
File and directory permissions in Linux / FreeBSD / MasOS
According to the Unix philosophy “Everything is a file”. And it is. But sometimes it’s difficult to understand all the rules to provide this statement. Let’s start from the most common problems that developers have when working with Unix-like file systems! Basic commands for setting file permissions To recursively change directories’ owner and group, useContinue Reading
Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
When working with MySQL / MariaDB database you can catch a strange error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) The same error in log files: [ERROR] Can’t start server : Bind on unix socket: No such file or directory [ERROR] Do you already have another mysqld server runningContinue Reading