Questions tagged [units]

For questions about the command-line unit converter.

Use this tag for questions about units, a terminal program that does unit conversions (including currency conversions) and calculations.

See:

18 questions
275
votes
18 answers

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 /var/www 1.8M /var/tmp 1.9G /var/named 2.9M …
xenoterracide
  • 57,918
  • 74
  • 184
  • 250
165
votes
20 answers

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 own bash/awk script, but I am looking for a…
Peter.O
  • 32,426
  • 28
  • 115
  • 163
5
votes
1 answer

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 but they both log all the backspaces and tab…
Nathaniel M. Beaver
  • 1,246
  • 13
  • 28
4
votes
0 answers

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 ([email protected]) but not when I leave out the instance identifier string…
4
votes
1 answer

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'. But which dependency in detail? This is how I…
Norman
  • 41
  • 1
  • 1
  • 2
2
votes
1 answer

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 formats, like "normal" dates with 4-digit years,…
0__
  • 674
  • 8
  • 22
2
votes
1 answer

What units are the values in /proc/partitions and /sys/dev/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 uses blocks since it says partition 1 has 5120…
Bret Joseph
  • 335
  • 1
  • 3
  • 12
2
votes
4 answers

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 which?
jackluo923
  • 21
  • 1
  • 2
2
votes
0 answers

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 problem because when I start my timer, systemd…
Guillaume
  • 121
  • 3
2
votes
1 answer

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 WantedBy=basic.target Here is what I previous wrote…
gunslingor
  • 149
  • 2
1
vote
1 answer

Mounting options with Systemd Mount Units

I used to use the fstab file for mounting drives. This time i wanted to use Units instead and created a .mount file. However i wonder how i would set a file system check option and umask settings there. For example in a fstab file you would do that…
Noobman
  • 13
  • 2
1
vote
0 answers

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

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 without any GUI or other cruft) and do it well…
Petr Skocik
  • 28,176
  • 14
  • 81
  • 141
1
vote
1 answer

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 meters to something else? $ units Currency…
Metamorphic
  • 1,109
  • 1
  • 10
  • 26
1
vote
3 answers

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 field indicates the units. I've listed all the…
Varludea
  • 13
  • 6
0
votes
1 answer

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 automatically launch it at startup, or when it…
Michael
  • 1
  • 2
1
2