New answers tagged

0 votes

What are the file size options for "find . -size" command?

POSIXly: find . -size 1000c # files whose size¹ is exactly 1000 bytes (not characters) find . -size -1000c # strictly less than 1000 bytes find . -size +1000c # strictly more than 1000 bytes Then, ...
Stéphane Chazelas's user avatar
0 votes

What are the file size options for "find . -size" command?

To add to what Stephen Kitt mentioned, beware that gnu find rounds up the size to the specified granularity before comparing! If you do truncate --size=1000 dummy_file_1000 truncate --size=1024 ...
Popup's user avatar
  • 534
3 votes
Accepted

What are the file size options for "find . -size" command?

POSIX only specifies no suffix or a c suffix. With no suffix, values are interpreted as 512-byte blocks; with a c suffix, values are interpreted as byte counts, as you’ve determined. Some ...
Stephen Kitt's user avatar
5 votes
Accepted

How to get display to show a pdf properly

You need to remove the alpha channel, rather than making it opaque — this will render the alpha information correctly (including anti-aliasing), then remove it. display -alpha remove file.pdf The ...
Stephen Kitt's user avatar
0 votes

Using find to list all files under certain directory

find ~ -type f -size +10M -exec du -sh {} + | sort -rh find ~: This specifies the directory to search for files in (~ in this case). -type f: This ensures that only regular files are considered, not ...
barakbd's user avatar
  • 101
1 vote

how to change font size locally in xfce-terminal?

One of the xfce folks helped me out, here's the solution xfce4-terminal --font "Sans 24"
jyoung's user avatar
  • 91
1 vote

Bash command to copy before cursor and paste after?

You can use ctrl+k and ctrl+y: # initial command cp /etc/prog/dir1/myconfig.yml█ # put cursor before where you want to copy cp█ /etc/prog/dir1/myconfig.yml # press ctrl+k cp█ # press ctrl+y twice ...
Mohammad Rahimi's user avatar
0 votes

How to switch to a different xdg-desktop-portal?

While the accepted answer is true, it didn't provide an answer as to the lower-level mechanisms that select one back-end vs the other or to allow someone to have low-level control. There are two ...
Seth Robertson's user avatar
0 votes

Set audio volume from terminal

I use pipewire. There are a couple of "native tools" for volume adjustment in pipewire: pw-cli (pipewire client) meets my definition of very difficult to use, but it does do volume control (...
Seamus's user avatar
  • 2,959
0 votes

How to specify that an optional argument requires 2 arguments in a zsh competition script?

I provided the comment above in hopes it would lead you to the example containing an argument array. Here's the example copied directly from the link: _arguments '-m[music file]:filename:->files' '...
eyoung100's user avatar
  • 6,347
3 votes
Accepted

How to place my own code snippets on command line à la history?

It might be worth exploring xdotool to solve your problem. According to the man page: xdotool lets you programatically (or manually) simulate keyboard input and mouse activity,move and resize windows,...
user9101329's user avatar
  • 1,117
1 vote

How to place my own code snippets on command line à la history?

in bash, shell-expand-line (keyboard shortcut M-C-e, usually ALT+CTRL+e) will "Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word ...
aviro's user avatar
  • 5,552
5 votes

How to place my own code snippets on command line à la history?

A quick and dirty contraption for interactive Bash (my bash --version prints 5.2.15): Put your desired (single-line) commands in ~/.commands. Define the following helper function: _get_command () { ...
Kamil Maciorowski's user avatar
1 vote

Command line friendly spreadsheets

There is sc-im, which is "sc Improved". While based on the original sc, there are some differences between sc-im and sc, as seen from the linked page. Notably, sc-im supports undo/redo, ...
husB's user avatar
  • 111
0 votes

Extracting json fields in a log line using awk or some other cli tool

Using Raku (formerly known as Perl_6) ...with Raku's JSON::Tiny module: ~$ raku -MJSON::Tiny -ne 'my %json = from-json($_.comb( / "\{" ~ "\}" .* / )); ...
jubilatious1's user avatar
  • 3,255
0 votes

How to run the command "sudo sh /path/to/script.sh" by double clicking?

I'm just a bit late here, and renzev already has a great answer for you. However, for the sake of completeness, I feel compelled to mention pkexec. Usage is as simple as pkexec /path/to/script.sh (...
LRitzdorf's user avatar
0 votes

Command line equivalent to "Safely remove drive"?

udisksctl provides unmount and power-off options! Examples: udisksctl unmount --block-device /dev/sda1 udisksctl power-off --block-device /dev/sda Seems to check all the boxes that 'Safely Remove ...
James Rivett's user avatar
0 votes

EXIF-based CLI renaming/querying tool for video/mp4?

Exiftool is a command-line tool that can extract and modify metadata in many media formats, including XMP metadata in video formats such as MP4. This includes filtering and renaming files based on tag ...
Gilles 'SO- stop being evil''s user avatar
0 votes

manipulate ls text output to add path to filenames

Simple solution for the simple case: % awk 'NF == 1 { dir = $1; sub(/:$/, "", dir); next } NF >= 9 { $9 = dir "/" $9; print; next } { print }' input.txt -rw-r--r-- ...
ilkkachu's user avatar
  • 139k
2 votes
Accepted

manipulate ls text output to add path to filenames

If none of your file or directory names contain white space then you could do the following using any POSIX awk: $ awk ' NF==1 && sub(/:$/,"/") { dir=$0; next } match($0,/[^[:...
Ed Morton's user avatar
  • 31.7k
0 votes
Accepted

The key combination Alt + 6 for copy in nano does not work in GNOME terminal emulator Tilix

In Tilix version: 1.9.6 you can manually change and set key commands. Disable Alt + 6 which is set to switch to terminal Nr.6. by default.
nath's user avatar
  • 5,704
-1 votes

Is there a command that outputs ONLY the packages explicitly installed by the user? (ubuntu/debian)

The OP seems to want a list of: "packages (ideally in Ubuntu) that I have [he has] installed". I read both of the answers here, and neither one came very close to giving me an answer to that ...
Seamus's user avatar
  • 2,959
1 vote

manipulate ls text output to add path to filenames

You can just do: ls -ld /etc/cron*/* The point being to pass the full paths of all the files to ls and be sure to pass the -d option so that for files of type directory, ls shows the info about the ...
Stéphane Chazelas's user avatar
1 vote

manipulate ls text output to add path to filenames

Solution with TXR Lisp. Let's take it for granted you got this ls output from somewhere and have to work with it; you cannot go back to the original time and machine and obtain the information in a ...
Kaz's user avatar
  • 8,476
0 votes

manipulate ls text output to add path to filenames

Not entirely sure what you want, but try this command: $ ls -la | awk -v path=$PWD '{$NF=path"\/"$NF;print}' |sed 's| /| \t/|g' You can drop the sed part if not interested in the alignment ...
user9101329's user avatar
  • 1,117
2 votes

manipulate ls text output to add path to filenames

You haven't shown us what command you are using or why you're getting this output, but if the objective is to list all files and directories matching /etc/cron*, you could just use find instead: find /...
terdon's user avatar
  • 242k
0 votes

How to check corrupt and duplicated fonts on Linux?

To find duplicate files, there is the program fdupes. fdupes -r /usr/share/fonts/truetype/
lumbric's user avatar
  • 389
0 votes

How to have tail -f show colored output

There is a new open source tool (Logdy.dev) that satisfies the need. You can use TypeScript to parse and transform the content of log messages. All of that in a web UI that comes filters/facets. ...
spinache's user avatar
3 votes

Where do I find documentation for the output of ls -l?

Yes, the fact that the size field is replaced by major, minor for device files as has been the case since at least Research Unix v5 in 1974 and documented there since at least Research Unix v6 (couldn'...
Stéphane Chazelas's user avatar
4 votes
Accepted

Where do I find documentation for the output of ls -l?

ls is specified by POSIX, that’s the common reference. The output formats are described in the “STDOUT” section.
Stephen Kitt's user avatar
0 votes

Zorin OS stuck on blank screen and blinking cursor on boot after changing the PATH variable

I've faced the same issue since I installed (upgraded) to ZorinOS 17.1 from 16.3. The system just gets stuck on a blank screen with a blinking cursor. This is after it shows the Zorin boot animation. ...
astroAJ's user avatar

Top 50 recent answers are included