Monday, May 23, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Minicom: send string when newline is detected

Posted: 23 May 2022 02:20 PM PDT

I have 3 different USB-to-UART FTDI cables and use minicom to debug some device. My problem is only one of these cables can buffer characters until I send a newline. Eg when I type the string "help", the device on the other side will not output the help string until I press Enter. The two other cables don't seem to wait for a newline when sending, typing the same string "help", I am seeing no output and newline will just add new lines to whatever I have typed.

I have enabled the following settings each time I start the minicom session:

  • echo on
  • linefeed on
  • carriage return on

The cables I am using are:

  • TTL-232R-3V3 (this one works)
  • TTL-232R-3V3
  • TTL-234X-3V3

Initially, I thought this was an issue with the cable but because another TTL-232R-3V3 has not worked, I think this may be a minicom configuration. But I can't find any configuration that would control this behaviour for my minicom session.

xinput custom.conf file only applies when terminal is opened

Posted: 23 May 2022 01:57 PM PDT

Backstory: I need to rotate my touch input at boot so that I can use my touch display.

I am successful in rotating the input with the following entered into the terminal:

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1  

After having help elsewhere and a bit of probing, I needed to create a custom.conf file in

/usr/share/X11/xorg.conf.d

In that file I have:

Section "InputClass"          Identifier "libinput touchscreen catchall"          MatchIsTouchscreen "on"          MatchDevicePath "/dev/input/event*"          Driver "libinput"      Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1"  EndSection  

Now here's the tricky bit that I need help with:

The touch input STILL does not automatically rotate with this in that file, until the moment that I open the terminal. This appears to be some kind of bug.

Why does the touch input not change it's matrix until I open the terminal? Is there a way around this?

Redirecting STDOUT to STDERR 1>&2 with sh [duplicate]

Posted: 23 May 2022 01:48 PM PDT

I am having a hard time understanding the difference between the order of 1>&2 and >. For example, I have file and file and don't have fie. Then diff fie file2 gives me error and I try redirecting the error message to stdout as follows:

$ diff fie file2 > out.log 2>&1  $ cat out.log  diff: fie: No such file or directory  

However, if I reverse the order as

$ diff fie file2 2>&1 > out2.log  diff: fie: No such file or directory  $ cat out2.log  $   

the output is different. Why is this? and if the STDERR and STDERR are merged by 2>&1, will the file descriptor 2 be empty? and can anyone point to a reference about >& and <& ? Thank you.

Couldn't download an URL using curl or wget but it works in browser

Posted: 23 May 2022 01:28 PM PDT

I'm trying to download the below URL via terminal:

https://wallpaperaccess.com/download/8k-graphics-4312822

I tried the below methods:

curl -L "https://wallpaperaccess.com/download/8k-graphics-4312822" -o 4312822.jpg  

The downloaded file did not open and looking at the size(4KB) that wasn't surprising.

wget --content-disposition "https://wallpaperaccess.com/download/8k-graphics-4312822"  

403 Forbidden

curl -L 'https://wallpaperaccess.com/download/8k-graphics-4312822' \            -H 'authority: wallpaperaccess.com' \            -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \            -H 'accept-language: en-US,en;q=0.9' \            -H 'cookie: PHPSESSID=****************' \            -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101"' \            -H 'sec-ch-ua-mobile: ?0' \            -H 'sec-ch-ua-platform: "macOS"' \            -H 'sec-fetch-dest: document' \            -H 'sec-fetch-mode: navigate' \            -H 'sec-fetch-site: none' \            -H 'sec-fetch-user: ?1' \            -H 'upgrade-insecure-requests: 1' \            -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36' \            --compressed > 4312822.jpg  

Copied from Chrome. Got the same 4KB file but did not open as expected.

But the same URL prompts me for a download in the browser or all download managers I've tested.

Usually, any URL that didn't work with cURL would work after copying from chrome with headers for me. But this time, I can't figure out not why it isn't working.

What am I doing wrong here?

VirtualBox won't open in Linux Mint

Posted: 23 May 2022 01:27 PM PDT

I installed VirtualBox from a deb file. The link to that file is below.

https://download.virtualbox.org/virtualbox/6.1.34/virtualbox-6.1_6.1.34-150636.1~Debian~bullseye_amd64.deb

I used the following command to install the deb file:

sudo dpkg -i *.deb  

After the installation was complete, I moved VirtualBox to my desktop and double clicked on it, but nothing happened. I waited a minute or two then double clicked on it again. Still, nothing happened. Did I install the package incorrectly, or is my particular version of VirtualBox not supported on my current OS?

My Linux Mint details are below:

Details

No loop device in container even with loop module loaded

Posted: 23 May 2022 01:13 PM PDT

I am trying to make it possible to make and mount loop devices from within a container. This happens to work on my own development system, but is failing to work on our build server where it must be done for an automated build.

I am ensuring that I'm starting the container as privileged. My container start line: docker run --privileged -it --rm <my_build_image>:latest /bin/bash. From within the container I try the following steps from the losetup man page:

# dd if=/dev/zero of=/var/tmp/file.img bs=1024k count=4  ...  # losetup --show --find /var/tmp/file.img  ...  

This should provide me the next unused loop device and have associated it to /dev/loopn. However, instead I'm presented with the following (and showing that the loop module is loaded and /dev/loop-control is present):

[root@64a3a6900e0d /]# losetup --show --find /var/tmp/file.img  losetup: Could not find any loop device. Maybe this kernel does not know         about the loop device? (If so, recompile or `modprobe loop`.)  [root@64a3a6900e0d /]# ls /dev/loop*  /dev/loop-control  [root@64a3a6900e0d /]# lsmod | grep loop  loop                   28072  0  

On my own dev box, this works. I loaded loop and started the container as privileged and was able to make loop devices. What should I check for now?

repair arch linux console

Posted: 23 May 2022 02:50 PM PDT

I was configuring my new arch linux that I just installed.

When I was installing zsh, I executed the command usermod --shell /usr/bin/zsh $USER, after executing that I got I realized that I forgot to install zsh, and now it gives me many errors and I can't use the console.

How to fix my console?

Do I need to move the configuration of some files or something like that?

How to use pipe with "sudo -ui"?

Posted: 23 May 2022 01:31 PM PDT

I have this command

cat ~/.ssh/id_dsa.pub | ssh root@[my_server] "cat >> ~/.ssh/authorized_keys"  

How can I do the same thing but with "sudo -iu user1" before the 2nd cat? That is, I want to change a user after having been logged in.

automount SSHFS on Ubuntu 20.04

Posted: 23 May 2022 03:09 PM PDT

looks like all the "automount SSHFS" are outdated and not working anymore on today desktops.

If I have a microSD card, that is shared via SFTP on an rpi, how can I auto-mount it on eg.: Ubuntu 20.04 desktops?

Tried with ex.:

sshfs#MYUSER@192.168.8.3:/stuff/ /media/user/stuff/  fuse.sshfs noauto,x-systemd.automount,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect,port=22 0 0  

but it doesn't work.. what only works so far is:

sshfs#MYUSER@192.168.8.3:/stuff/ /media/user/stuff/ fuse defaults,auto,allow_other,noatime,port=22,IdentityFile=/home/user/.ssh/id_rsa,user 0 0  

but this requires me to do a "mount -a".. which is not very automatic :)

The question: as a normal user, how can I mount an SSHFS share only on demand? So if I am in that directory (in eg.: GNOME os in the terminal, ls or cd or "cp from tothatshare") Havin SSH key login with no password.

Many Thanks.

/etc/resolv.conf gets modified regularly

Posted: 23 May 2022 12:39 PM PDT

I'm running Ubuntu 20.04 on my home server (including Pi-hole with DHCP). Frequently, including but not just after reboots, DNS resolution on the system breaks entirely because /etc/resolv.conf is changed to use 127.0.0.53.

The 53 is interesting to me, being a port used for DNS but this is an IP address. Nevertheless, I do run Unbound with Pi-hole (on port 5335) and I think that could potentially be related?

The file says Generated by NetworkManager at the top, and my NetworkManager config in /etc/netplan is:

# Let NetworkManager manage all devices on this system  network:    version: 2    renderer: NetworkManager    ethernets:      enp1s0f0:        dhcp4: no        addresses:          - 10.45.1.2/24        gateway4: 10.45.1.1        nameservers:            addresses: [127.0.0.1, 10.45.1.2]  

As this server handles DHCP for my network, I've disabled dhcp4 and used this to force my network settings. (All of the other values in here work perfectly, constantly.)

When I run sudo netplan apply, the IP in /etc/resolv.conf returns to 127.0.0.53.

As you can see I've even tried adding the LAN IP of the server to the network config, but to no luck. I've also tried different resolv or dhcpc changes but neither of them exist on my system or change anything.

Is there a way I can fix this? It's breaking a few of the services I run on here!

SSH connect to a docker container directly, without ssh the host first

Posted: 23 May 2022 12:20 PM PDT

On my local computer, I connect with ssh to a distant VPS: ssh user@1.2.3.4.

In this VPS, a docker container is running (for example docker pull nvidia/cuda:11.4.0-devel-ubuntu18.04 and docker run -itd --name test nvidia/cuda:11.4.0-devel-ubuntu18.04 ...)

What is the standard way to connect directly from my local computer to this container via SSH and directly have a bash prompt?

Is it possible to do it in one step instead of:

ssh user@1.2.3.4  docker attach test  

Is "running a folder" possible in Linux?

Posted: 23 May 2022 01:39 PM PDT

Is there a philosophy behind running a folder as an executable in linux?

user@node main % ls -lash ./bin  total 0  0 drwxrwxrwx  2 user  staff    64B May 23 21:04 .  0 drwxr-xr-x  6 user  staff   192B May 23 21:04 ..  user@node main % ./bin           zsh: permission denied: ./bin  

Permission denied implies that it may be allowed. If it's not, then why is it permission denied rather than something like can't run a directory?

Or is it just a weird artifact of the API when directories are involved in this way?

P.S. I am aware that x flag is adopted in the directory context to allow/deny cd-ing into them and long-listing (ls -l) them, this is not what this question is about.

P.S.S. In Python, a directory can be treated as a python "executable" if it has a certain file structure inside. (I.e. It's possible to pass a directory instead of a python file to be run by the python interpreter).

Cannot perform Symbolic Link with Splunk and Linux

Posted: 23 May 2022 03:26 PM PDT

I am using Splunk with Linux currently.

For the last few days, I cannot execute the following: enter image description here

Can you please help as I need to execute this Symbolic link?

Many thanks, Patrick

Manually telling EXT4 about bad sectors?

Posted: 23 May 2022 01:23 PM PDT

The drive is currently in NTFS. After running chkdsk for hours, I have found the locations of bad sectors (below). I want to reformat the disk in EXT4. I have heard that EXT4 has some sort of metadata to mark bad sectors, and there is a utility for that, but I do not want to run the test for hours again. Can I just directly tell EXT4 about the bad sector locations below that I have already found by chkdsk?

Stage 4: Looking for bad clusters in user file data ...  Read failure with status 0xc000009c at offset 0x280036f1000 for 0x10000 bytes.  Read failure with status 0xc000009c at offset 0x280036fb000 for 0x1000 bytes.      Read failure with status 0xc000009c at offset 0x280cb987000 for 0x10000 bytes.  Read failure with status 0xc000009c at offset 0x280cb993000 for 0x1000 bytes.      Read failure with status 0xc000009c at offset 0x280dbdc2000 for 0x10000 bytes.  Read failure with status 0xc000009c at offset 0x280dbdc4000 for 0x1000 bytes.      Read failure with status 0xc000009c at offset 0x2835d5bb000 for 0x10000 bytes.  Read failure with status 0xc000009c at offset 0x2835d5c0000 for 0x1000 bytes.  

Making Xinput commands permanent "For complete noobs"

Posted: 23 May 2022 01:06 PM PDT

As the title suggests, I need to rotate the touch input on a DSI display.

I am successful in rotating the input with this entered into the terminal.

xinput set-prop 'seeed-tp' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1  

I need this to happen on boot.

I have read that adding them to ~/.xsessionrc and or ~/.xinputrc is the right thing to do

However I do not know where .xsessionrc OR .xinputrc are located, and even if I did, I do not know how to add a command to those files to make them work.

Please advise for the total noobs please.

me

Change text using bash

Posted: 23 May 2022 02:51 PM PDT

I have a program called gamemode, and to check if it's running, you can use gamemode -s, which outputs either "gamemode is active" or "gamemode is inactive".

I want to change "gamemode is active" to "<an icon that doesn't show on this website>" and change "gamemode is inactive" to some other icon.

How to create an ephemeral user-level systemd timer on the commandline without unit/timer files?

Posted: 23 May 2022 12:31 PM PDT

Suppose I want to run the command notify-send "invoked" "$(date)" every 5 seconds using systemd timers.

I know how to create a corresponding unit file and a timer file, then enable the timer for user, but I want a pure CLI-based solution.

I want to simply do the above in commandline without needing to create 2 files. Something like: systemd-blah enable my_command --every 5s.

How to use clipboard-cli on Wayland?

Posted: 23 May 2022 04:05 PM PDT

I am using this module gtts-cli for text to speech conversion.

more info here-> https://gtts.readthedocs.io/en/latest/cli.html

Basic syntax is

$ gtts-cli 'hello' --output /tmp/hello.mp3 && vlc --play-and-exit /tmp/hello.mp3 && rm /tmp/hello.mp3  

I want to write a bash script where the highlighted text (from firefox for example) is sent as a variable to the text portion (in quotes) in the above syntax. I'm on Wayland so I can't use xsel. Then, after VLC finishes playing the mp3 file, I would like vlc to autoclose itself and finally delete the generated mp3 file. Ultimately, I would like to bind the script to a keyboard shortcut. Highlight some text on the screen, then run the script using the shortcut.

Is there an easier way to achieve this? gtts-cli 'hello' outputs a bunch of random characters. Is it possible to pipe the stdoutof gtts-cli 'hello' as stdin to VLC?

Bash completion appends a space after a word - how can I stop this?

Posted: 23 May 2022 03:37 PM PDT

I'm writing a tab completion script for Bash, using Python to deliver the results of the completion. I'm using a dummy script to show the problem I'm having, the content is not important.

I've got a Bash script called dothat, with the following code:

var=$1  echo "You have chosen $var"  

I've also got a script which creates the tab-completion for dothat, called dothat-completion.bash:

_comp_func()  {      COMPREPLY=()        # Gets the output of a Python file and puts it into a variable      fruits=$(python fruit.py)        COMPREPLY=($(compgen -W "${fruits[*]}" -- $cur))   }    complete -F _comp_func dothat  

And the (simple) content of fruit.py:

print('fruit:', end='')  

The Python script just prints the string to STDOUT, and this is then captured by the Bash completion function, and used to generate possible matches for tab completion.

Now, what I want to do with this script is, when I type dothat <TAB>, it will then complete to dothat fruit:, with no space on the end. The problem is, when I type dothat and press tab, it completes to dothat fruit: , with the unwanted trailing space.

I've tried changing the contents of the Python to the following, and all with the same result:

print('"fruit:"', end='')  print("'fruit:'", end='')  print('fruit:', end='')  print("fruit:", end='')  print("fruit: ", end='')  print("fruit:          ", end='')  print('fruit')  

Even:

foo='fruit'  print(foo)  

And all of my attempts are fruitless, as they achieve the same result. It doesn't matter whether there are zero, one or twenty spaces on the string: if the Python outputs the string fruit: and feeds it back into the Bash completion script, compgen will decide to complete fruit: with a space.

Is there an obvious solution here that I've missed? For either the Bash or the Python?

How to follow journalctl since boot?

Posted: 23 May 2022 03:35 PM PDT

journalctl --boot prints log lines since boot and journalctl --follow prints the last 10 lines of the log and then follows it. But journalctl --boot --follow doesn't work like I expect it to. Rather than printing all the journal lines since boot and then following the journal it just ignores --boot flag. Swapping the flags around makes no difference. How do I print all the log lines since boot and then follow the log?

Version info:

$ journalctl --version  systemd 239  +PAM +AUDIT -SELINUX +IMA +APPARMOR +SMACK -SYSVINIT +UTMP -LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid  

Slow download speed with rtl8821ce on Pop!_OS 18.04

Posted: 23 May 2022 01:07 PM PDT

I recently bought a HP 15-da0206ng laptop and since my goal was to finally switch from Windows to Linux I installed the Linux distribution Pop!_OS 18.04 LTS which is built on Ubuntu 18.04 LTS.

After I installed the OS, I encountered a problem: No WIFI Adapter was detected. The WIFI Adapter in the HP 15-da0206ng is a Realtek RTL8821CE 802.11b/g/n/ac, according to HP. I quickly found a solution for this:

https://askubuntu.com/questions/1071299/how-to-install-wi-fi-driver-for-realtek-rtl8821ce-on-ubuntu-18-04

I disabled secure boot in BIOS, connected my Laptop via cable updated and upgraded and installed the driver and my WIFI Adapter was detected and worked. However, my download speed via wifi is very slow. The terminal and the browsers (Firefox and Chrome) download everything with a speed of around 85 kb/s. According to this site (it is a German site):

http://www.speedmeter.de/

my download speed is at 0.6-0.7 mbit/s. My upload speed is at 5 mbit/s which I consider normal. I did the same speed check with my Samsung phone and it reaches a download speed of 102 mbit/s and an upload speed of 5 mbit/s. Something is clearly wrong with the download speed of my Notebook.

After researching this problem I found this thread: https://askubuntu.com/questions/1148030/slow-wifi-connection-ubuntu-18-04/1148065?r=SearchResults#1148065

but switching antennas resulted in no difference. Selecting a specific antenna explicitly seems to be a working solution if your wifi signal is not strong, as it is explained here: https://askubuntu.com/questions/1058379/wifi-signal-is-weak-in-ubuntu-18-04-with-rtl8723be

In my case I would say that the signal strength is not a problem. As you can see in the results of running nmcli dev wifi list

IN-USE  SSID                            MODE   CHAN  RATE        SIGNAL  BARS  SECURITY     *       Burt-Reynolds                   Infra  1     405 Mbit/s  82      ▂▄▆█  WPA2   

I also turned of power saving for the wifi adapter as described at the bottom of this readme: https://github.com/tomaspinho/rtl8821ce/blob/master/README.md but it did not make any difference as well.

I upgraded the kernel from 4.18 to 4.19 but there was no change. I tried to install Ubuntu (instead of Pop!_OS) 18.04 but here I did not manage to install the rtl8821ce drivers at all. Currently I am running Pop!_OS 19.04 where I can install the drivers again but the download speed is still painful slow.

Furthermore I went through this troubleshooting: https://support.system76.com/articles/wireless/

which means I tried to change the router configuration, I disabled IPv6, I enabled Antenna Aggregation, I tried to disable the N mode in /etc/modprobe.d/iwlwifi.conf and I disabled bluetooth coexistence.

I am not quite sure what to try anymore and my next steps will be to buy a usb wifi adapter or, the worst case, install Windows again. It seems that most questions related to the rtl8821ce are about getting it not working at all. In my case it works but very slowly. I am not sure if I am missing something obvious and that is why I decided to post this problem here.

Here is some additional hardware information:

Intel® Core™ i5-8250U  DDR4-2400 SDRAM, 16 GB        256 GB PCIe® NVMe™ M.2 SSD  Intel® UHD Graphics 620  

Thanks in advance.

Error in scp connection in Linux

Posted: 23 May 2022 04:02 PM PDT

I have got an below error while executing the below command while placing a file in gatekeeper example server through a script.

scp -oHostKeyAlgorithms=+ssh-dss -i ~/.ssh/gatekeeper -P 18000 /var/applications/TEST_20190130.csv 74570-1@isdw-test.avc.db.com  

The error is:

29/01/19,05:51:44 ** Start transfer to gatekeeper isdw-test.avc.db.com:  command-line line 0: Bad protocol 2 host key algorithms '+ssh-dss'.^M  lost connection  29/01/19,05:51:44 ** !!! File transfer to isdw-test.avc.db.com: Failed !!!  

But, when I ran this command manually and able to place file in the server.

scp -oHostKeyAlgorithms=+ssh-dss -i ~/.ssh/gatekeeper -P 18000 /var/applications/TEST_20190130.csv 74570-1@isdw-test.avc.db.com  

Remote SSH command fails only in shell script with error: "No such file or directory"

Posted: 23 May 2022 03:38 PM PDT

I am trying to run a script on a remote system using ssh, when i run the command on the terminal it executes fine but when i embed the command in a shell script it returns an error.

Command 1:

cmd="ssh root@IP \"python /pathtoscript\""  `$cmd` > log.log  

for the above command i tried the following suggestions from stack exchange:

 cmd="ssh root@IP \"bash -c 'python /pathtoscript'"   cmd="ssh root@IP '/user/bin/python /pathtoscript'"  

Command 2:

ssh root@IP "ls -1v /path"  

Note: All these commands work on the terminal.

Edit:

If I run the command on the terminal it executes fine and displays the output. Now if the same command is added to a script (.sh), I see the following error:

bash: ssh root@IP 'python /pathtoscript' : No such file or directory  

Automating dirb for scanning several URLs

Posted: 23 May 2022 03:00 PM PDT

I have a bit of a problem making this script work and was wondering if anyone knew what the problem is. It is supposed to take a list of urls as input, scan them for sub directories and then output it to different files.

for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt > $fn; done  

This script does correctly remove slashes for the new file but I get the error (translated from Swedish) that ": no such file or directory". Probably from the > $fn part.

for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt -o $fn; done  

And trying to use dirb's own output I instead get an error like

"OUTPUT_FILE httpwww.website.com  (!) FATAL: Error opening output file: httpwww.website.com"  

And some clarification regarding the one liners:
1) loop through a list of urls
2) output the url to terminal
3) generate filename from url using sed
4) output filename to terminal
5) run url through dirb and try to output it to file name

The supposed output file names look fine to me but aren't working. Does anyone know why that is?

How can I restart Firefox from the command-line?

Posted: 23 May 2022 02:52 PM PDT

How can I restart Firefox from the command-line and restore the previous state completely (or as much as possible) after restart? Sure, I can do something like killall firefox; firefox, but that would not restore the session.

Any non-whitespace regular expression

Posted: 23 May 2022 04:34 PM PDT

Im trying to match a string agains a regular expression inside an if statement on bash. Code below:

var='big'  If [[ $var =~ ^b\S+[a-z]$ ]]; then   echo $var  else   echo 'none'  fi  

Match should be a string that starts with 'b' followed by one or more non-whitespace character and ending on a letter a-z. I can match the start and end of the string but the \S is not working to match the non-whitespace characters. Thanks in advance for the help.

How to install AMD Catalyst on Fedora 22 with GNOME?

Posted: 23 May 2022 02:02 PM PDT

today I installed AMD Catalyst on Fedora 22. After rebooting my computer, my screen was black.

I have read several guidebooks, but I have not found a way to run "Catalyst" on GNOME on laptops.

If someone has managed to run GNOME on Fedora 22 and has a laptop, let me know please.

how to execute commands on remote server as different user

Posted: 23 May 2022 12:17 PM PDT

I am trying to connect to server B from server A using ssh and executing commands using some other user. However, when I try searching for a pattern in log file it says "cannot open log file" below is the sample code

ssh  -t user@hostname <<EOF  sudo su - someotheruser  a=`tail -10 /somepath/application.log | awk '/Agent Exited/ { print $3 }'`  if [ $a -eq 0 ]   then  echo "Success"  else  echo "Failure"  fi   EOF  

once I run the script, it says, unable to open "tail........."

I can't stay logged in on server B and run multiple commands.

Can w3m automatically search the entered text?

Posted: 23 May 2022 01:22 PM PDT

Is there a way to configure w3m so that with 'U', i.e. after entering text into the URL field, the browser will automatically prepend "google.com/search?q=" to it?

Or can some other command be used or defined to obtain the same effect? I tried calling a shell script via "#" but it just passes output into buffer.

Move every file that is not a directory

Posted: 23 May 2022 12:12 PM PDT

I have a directory that I am trying to clean out that contains both files and subdirectories. What I am trying to do is simple: move all the files into another directory, but leave all the sub-directories as they are.

I am thinking something like:

mv [*_but_no_dirs] ./other_directory  

It seems like there should be a simple way to do this with wildcards * and regex...

Anyone have ideas?

No comments:

Post a Comment