Questions tagged [units]

For questions about the command-line unit converter.

Filter by
Sorted by
Tagged with
0 votes
1 answer
70 views

Interact with Linux service via SSH

I've rented a server which I access using the Terminus SSH terminal. I've created a program that has prompts and takes input and works as intended when started normally. But I've created a service to ...
0 votes
1 answer
31 views

Issues creating boot and shutdown systemd daemon

I'm trying to create a config file for my unit but when I start the daemon after enabling and shutdown the computer it doesnt works. The script only executes the ExecStart line after network.target on ...
  • 58
0 votes
1 answer
853 views

Gnome (Debian 11): How to install en_DK formats (date, numbers, units)?

I switched my system from Debian 10 to 11 (new computer), so I'm trying to revert to my normal settings. I have installed with en_US locale, which I do want for UI texts, but I need to revert to ISO ...
  • 634
0 votes
2 answers
27 views

How to get just the number from units?

The default output of units seems to be a bit verbose: $ units "2 fortnight" seconds * 2419200 / 4.1335979e-07 Suppose I just want the number only, so that I can do things like ...
  • 159
1 vote
1 answer
50 views

How do I tell the "units" command to use a different length unit by default?

By default, the GNU units command outputs length units in meters. If I want to use a different unit, I have to specify this manually at the You want: prompt. Is there a way to change the default from ...
  • 1,081
2 votes
1 answer
2k views

What units are the values in /proc/partitions and /sys/dev/block/<block>/size?

I have a sample emmc block info from an android device From /proc/partitions major minor #blocks name 179 1 5120 mmcblk0p1 Using my little intelligence I am assuming /proc/partitions ...
-1 votes
1 answer
468 views

Human-readable `du` with finer grain

I sometimes wish human-readable du -h option to be more fine-grained while still human-readable. Instead of showing: 14G it would show something like: 14G 236M 788k 110b Is there an easy / ...
  • 2,511
4 votes
0 answers
2k views

Polkit rule for systemd template unit files

I'm trying to figure out how to write a polkit rule for a systemd template file. The rule is triggered when I use the actual service that will be instantiated (openvpn-client@miami.service) but not ...
2 votes
4 answers
5k views

Filesystems Size Single Letter Abbreviation

In many file system related man page, the units are represented by single letters [bBsSkKmMgGtTpPeE]. What do the upper case and lower case mean? I.e. megabyte, megabit, mebiyte, mebibit, which one is ...
4 votes
1 answer
12k views

systemd // failed with result 'dependency'

I'm quite new to this systemd topic. I have some Units with varios Requires, After and Before. On some Units I got messages like: tinc.service: Job tinc.service/start failed with result 'dependency'. ...
  • 41
2 votes
0 answers
1k views

Systemd doesn't start a timer unit

I would like to create a timer that launch a command every 2 months (the first of the month) I already do that with a cron, but I would like to do the same with systemd and get rid of cron. I have a ...
  • 121
2 votes
1 answer
771 views

What is wrong with my systemd unit file?

Here is my unit file: [Unit] Description=Backend Service After=mariadb.service Requires=mariadb.service [Service] Type=simple ExecStart=/var/www/html/pythonscripts/Backend.py [Install] Alias=BEd ...
1 vote
3 answers
1k views

CSV Units Conversion

I've got a CSV file that looks like the following: miami,20,in lansing,2,cm austin,3,mm chicago,5,miles phoenix,2,feet The first field is the name, the next field is the numeric value and the third ...
5 votes
1 answer
1k views

Logging interactive input and output without capturing all typed input and control characters

I am trying to log output from an interactive command-line program; units, specifically. I have tried using tee like this: units | tee units.log or script like this: script -c units units.log ...
1 vote
0 answers
72 views

Tool to convert between human-readable byte sizes and bare byte counts [duplicate]

Can you recommend a Unix-style tool that converts between human-readable bytesizes (e.g., 10KiB->10240, 10240->10KiB)? By Unix-style I mean that it should do just this (i.e., be just a simple filter ...
  • 27.6k
159 votes
20 answers
78k views

A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1

Is there a standard tool which converts an integer count of Bytes into a human-readable count of the largest possible unit-size, while keeping the numeric value between 1.00 and 1023.99 ? I have my ...
  • 32k
269 votes
18 answers
276k views

How do you sort du output by size?

How do you sort du -sh /dir/* by size? I read one site that said use | sort -n but that's obviously not right. Here's an example that is wrong. [~]# du -sh /var/* | sort -n 0 /var/mail 1.2M /...