4
votes
Is there a terminal emulator like powershell or Windows Terminal, for Linux?
Ctrl + Shift + C/V are normally used to copy/paste text in the graphical Linux terminal.
For autocompletion you simply press Tab twice.
4
votes
How to concatenate files in reverse order
This is different to tac as tac will concatenate the files with reversed line order
… and not in the desired reverse sequence of files. Surprisingly this is good, because an additional tac acting on ...
4
votes
Why are neither rename nor mmv working on my Fedora 35 system?
You are missing the replacement marker. Try this instead:
mmv '*.jpg' '#1-new-suffix.jpg'
2
votes
fish: cd to the most recently modified child directory
Rather than relying on the output of ls, and assuming you have GNU coreutils:
cd (stat --printf='%Y:%n\0' ./*/ | sort -zt: -k1nr | head -zn1 | cut -d: -f2-)
2
votes
fish: cd to the most recently modified child directory
You can do
ls -dt ./*/ | read newest && cd $newest
Though note that it doesn't work properly with filenames that contain newline characters.
With recent versions of GNU ls, you can address it ...
2
votes
fish: cd to the most recently modified child directory
In fish, you cannot use $(command), you have to use (command) instead. More info
Also, in fish, the backslash in front of ls should be replaced with command
So to sum up, use:
cd (command ls -1dt ./*/...
2
votes
Accepted
fish: cd to the most recently modified child directory
What did you try? In particular fish is telling you to use '(\ls)'. So
cd (ls -1dt ./*/ | head -n 1)
seems to work based on 10 seconds of experimentation.
Edit: Remove \ character.
2
votes
Why does this screen session exit when the command is finished?
Using "bash -c" results in a non-interactive shell. You're creating a process tree as such:
screen───bash───ls
When ls finishes, bash has no further process and no further input and ...
2
votes
Accepted
Return content between corresponding brackets
What you've offered isn't valid JSON. Bracketing the expression, fixing up the other errors, and adding a counter-example:
{
"text": [
{
"string1": ["...
1
vote
Rename files with numbers already in file name
With zsh:
autoload -Uz zmv
To autoload that batch renaming function (best in ~/.zshrc)
zmv -n '(water-frames)(<0-999>)(.gro)' '$1-${(l[4][0])2}$3'
Remove -n when happy.
1
vote
Accepted
Rename files with numbers already in file name
Using the perl rename utility:
$ rename -n 's/(\d+)(\.gro)$/sprintf "-%04i%s", $1, $2/e' ./*.gro
rename(./water-frames0.gro, ./water-frames-0000.gro)
rename(./water-frames116.gro, ./water-...
1
vote
Is it possible to have terminal make a sound when a compilation fails?
You'd do:
make || some-command-that-generates-some-sounds
Where some-command-that-generates-some-sounds could be printf '\a' which sends the BEL character upon which terminals usually emit a beep ...
1
vote
How to concatenate files in reverse order
Try "Brace Expansion" (cf. man bash):
set -vx
cat file{3..1}
+ cat file3 file2 file1
1
vote
Accepted
Replace text in terminal
Have you considered a variable?
prj1='name@server.com:/project1' # Define variable
scp -p "$prj1/data/" data1/ # Use it
Or you could use a function
prj1scp() { scp -p "name@...
1
vote
Is there a terminal based visualizer for linux that plays background music from default audio source?
I think you are looking for something like cava
From the README.md :
C.A.V.A.
Console-based Audio Visualizer for ALSA
also supports audio input from Pulseaudio, fifo (mpd), sndio, squeezelite and ...
1
vote
How Do I install debian packages onto mac-osx-mojave (10.14)
You cannot install Debian packages compiled for another architecture or operating system than macOS on a Mac.
However, you can install apt and Debian packages compiled for macOS on a Mac by using the ...
1
vote
How to solve the issue that a Terminal screen is messed up? (usually after a resizing)
Run resize after resizing your terminal window. It will update COLUMNS and ROWS to the correct values.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
terminal × 3908bash × 709
linux × 564
shell × 400
command-line × 286
macos × 215
ubuntu × 210
ssh × 193
colors × 185
shell-script × 179
tty × 157
tmux × 153
debian × 134
gnome-terminal × 132
zsh × 131
keyboard-shortcuts × 120
terminal-emulator × 116
gnu-screen × 111
console × 94
xterm × 91
escape-characters × 88
vim × 85
process × 76
centos × 73
linux-mint × 73