Skip to content

tech.

How to Create programs, Fix, Find and Configure them

  • Tips&Tricks
  • How to fix
  • For Beginners
  • English
    • Español
    • Deutsch
    • Français
    • 简体中文

Month: January 2019

Tips&Tricks

How to run a program as daemon without any output

Gosh On January 30, 2019January 30, 2019
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


Tips&Tricks

How to get top 10 largest files

Gosh On January 29, 2019January 29, 2019
How to get top 10 largest files

As we already saw, we can easily get to 10 largest directories (see “How to get top 10 largest directories in the current directory“). But there we used du utility – it shows directory size (or “estimate file space usage”). What utility shows file size? Oh… It’s just the ls! Looks easy? But we needContinue Reading


Tips&Tricks

How to make an immutable file

Gosh On January 29, 2019January 29, 2019
How to make an immutable file

As we already know, files have access right matrix (read more in this article: “File and directory permissions in Linux / FreeBSD / MasOS“). But that’s not all. There are more mechanisms for accessing files. For example, we can change file’s attributes. One of them is immutability attribute. Users with high capabilities can set /Continue Reading


For Beginners

Three useful keys of tail util

Gosh On January 29, 2019January 29, 2019
Three useful keys of tail util

tail – output the last part of files. Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input. Tail’s keys Show last ‘num’ lines in file: tail -n {{num}}Continue Reading


Tips&Tricks

How to get top 10 largest directories in the current directory

Gosh On January 29, 2019January 29, 2019
How to get top 10 largest directories in the current directory

Sometimes it’s not obvious, which directory is too big. To find the biggest directories in you computer, you may use graphic user interface and some of supported file managers. But what will you do when you don’t have a GUI? And it’s not mythical situation. On the desktop you almost always know the biggest directoryContinue Reading


For Beginners

Useful keyboard shortcuts in Bash for beginners

Gosh On January 29, 2019January 29, 2019
Useful keyboard shortcuts in Bash for beginners

Hotkeys in Bash helps you use Bash more efficiency. Most of them have slower analogs. But some of them help you easier do common things. Ctrl + a – Return to the start of the command you’re typing Ctrl + e – Go to the end of the command you’re typing Ctrl + u – Cut everything beforeContinue Reading


For Beginners

Bash history util for beginners

Gosh On January 29, 2019January 29, 2019
Bash history util for beginners

history is a program for tracking terminal input. Many programs read input from the user a line at a time. The GNU History library is able to keep track of those lines. It associates arbitrary data with each line, and utilize information from previous lines in composing new ones. Tips and examples Display the commandsContinue Reading


Tips&Tricks

How to fix the last command in Bash

Gosh On January 29, 2019January 29, 2019
How to fix the last command in Bash

Sometimes we all makes mistakes. And it’s good if this is just typo in command name and we don’t erase important data. So, if it was just a typo Bash gives to us easy way to fix it! Takes the last command, replaces string1 with string2 and executes it. ^string1^string2 For example: $ ehco fooContinue Reading


Tips&Tricks

How to get top 10 commands

Gosh On January 29, 2019January 29, 2019
How to get top 10 commands

It’s more like a joke / just for jun task. But it also perfectly shows one of the Unix principle: Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new “features”. Actually even two principles; Write programs to handle text streams, because thatContinue Reading


Tips&Tricks

How to copy from a terminal to the Linux or MacOS system clipboard

Gosh On January 29, 2019January 29, 2019
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


Posts navigation

Older Posts
arrow-right

Recent Posts

  • How to use/add a self-signed certificate to Mac OS
  • How to delete all Docker images and containers
  • How to change permissions for file / directory recursively in Linux
  • How to install non-free video / audio codecs in Ubuntu
  • Python 3 performance profiling – easiest way

Archives

  • February 2020
  • June 2019
  • January 2019

Categories

  • For Beginners
  • How to fix
  • Tips&Tricks