bash's questions - English 1answer

6.800 bash questions.

I have 280 thousand photos to delete in a folder, but some videos to keep. in the folder, I gave the command: #rm *.jpg but get "argument list too long" when I create an argument to delete some of ...

I was wondering whether it is possible to submit form data by POST method using shellscript (or anything else that works). To elaborate, I had participated in an online quiz contest where the answer ...

I would like to scan all images in a linux directory (recursively within sub-folders), and find those with resolution higher than a specific threshold (e.g. say those with resolutions at least 800x600 ...

I'm running a script in bash on a Mac, and I am trying to split a string with the delimiter being a space into an array. The command I'm running is: array = ($(echo "$string" | tr ' ' "\n")) that ...

I have variables in a bash script that I need to be carried over into a perl one. I have the variables $gal and $obsid declared in the bash script, and then I call the new program. gal=UCLA121 obsid=...

Let's say I have a coordinate (x,y), I want to make two categories: good or bad. I have no idea how to put it into words or keywords, so I create the case of what I want. I have created a bash ...

I currently have a cron job that I need to stop on shutdown. During power off, I currently run a "shutdown" script, but I am unsure of how to take the PID number I get from ps -ef | grep cron and put ...

I am new to bash scripting and linux terminal, I want to run a command in kde konsole from the konsole and/or bash script. The command is as below - konsole --hold -e "ls -la" The problem with ...

Sometime I want to edit RTL text with a specific font. I find it cumbersome to change font all the time. Is there a way I can tell gedit to set a certain font when launching it via cli. The cli ...

In the latest versions of ubuntu, right clicking on a file doesn't give you the possibility to create password protected archives (see this question). I still need to do that kind of things though so ...

I don't know how to explain myself but I need to send scheduled messages via telegram so I downloaded the telegram client to send messages via terminal. I wrote a bash script that opens the client, ...

What I want to achieve is to automatically install NPM packages, so I created a separate variable which holds "sudo npm install" and iterating over an array which has the package name. Facing error ...

I can't find .bash_profile in Ubuntu 14.04 in my /home/user directory. I used the ls -a command to see the .bash_profile, but there isn't such a file.

I have script test.sh: #!/bin/bash declare -x "v"="24127" echo "$v" #works anyway eval echo "$v" #works anyway eval "$@" #works fine if not in second eval "$@" ...

I try to run a shell script file but failed so far on Ubuntu. In my terminal: ~/Desktop/FTL/data$ ls amd64 exe_icon.bmp FTL licenses resources x86 ~/Desktop/FTL/data$ sudo bash ./FTL.sh [sudo] ...

I have some files (image-1.nii, image2.nii, etc.) in a folder (INPUT_DIRECTORY) which are inputs to a command, and the result files should be saved in two other directories (BIAS_DIRECTORY,...

I've never written a shell script before, but I have a web app that needs a whole bunch of things running at once, and it's irritating to have to open each tab, change directories, start my processes, ...

I have a structure where one folder contains many subfolders that each have some .txt documents in it. I'm looking for a way to find the average text lengths (in words). Therefore I want to count the ...

I've created the following bash script, which restarts my parse server: pkill screen screen cd /datadrive/parse-server-example/ sudo npm start The thing is, it seems that the script doesn't execute ...

I have a directory with a bunch of .dcm files (they are medical scans) that looks like this: J6071c1.dcm J6071d7.dcm J6071ed.dcm J607203.dcm J607219.dcm J60722f.dcm J6071c2.dcm J6071d8.dcm ...

As root, I run root@myself:~# echo disable | sudo tee /proc/acpi/ibm/fan; sleep 5; echo enable | sudo tee /proc/acpi/ibm/fan but I get disable tee: /proc/acpi/ibm/fan: Invalid argument enable tee: /...

For example, elif [[ $append = $1 ]] then touch ~/directory/"$2".txt echo "$variable_in_question" >> ~/directory/"$2".txt to either create a text file containing all input following "$2" , ...

I am trying to create a script to execute a java command to open an application, but I can't find any way to do that. Here is the command I'm trying to execute, if it helps. java -jar /home/...

I prepared an image and included in /etc/rc.local a line to run a script: /path/to/myscript.sh I then created a script at that location It contains a curl, to download and save a file as new file ...

I have an input directory (INPUT_DIRECTORY=${PWD}/INPUT) and a directory for output to save files into it a bash command (OUTPUT_DIRECTORY=${PWD}/Output) and a file (image-99.nii) need to be written ...

I have installed Immortal and I would like to start a script contained in a .sh file. I've tried looking at the docs but I always get a missing command error. This is what I have tried: immortal -l ...

I've just started learning about shell scripts and they are a blast on my rookie experience with Linux. Currently i have made a script which prints out some stuff and finally opens up a program. ...

When I go to /bin or /usr/bin, I see many formats. For example, in /bin, there are three type of files: Files like bash. Files like less. Files like zgrep. I can open, read or modify the third group(...

I need to get the MD5 hash of an online file, and then compare it to a file on the local machine. How can I do this in bash?

Is there a simple way to retrieve someone's tweets from the command line? The account would be public, and the command - or script, if necessary - would retrieve all or a specified number of most ...

What I want to do is write a script which first launches a program and then tells it to execute a bunch of commands and then quit. Lets go with an example. I wrote this script myscript.sh and it doesn'...

I used to run several scripts at startup to set things the way I want my server running. After migrating to Ubuntu 18.04, I am having trouble with a few scripts and I am just wondering if this is ...

Sometimes, processes ignore the SIGINT signal sent by Ctrl-C in Bash. For instance, man and vi. Assuming you don't want to google or read the manual on how to exit the running process, is there any ...

When using sudo to allow edits to files, I regularly get 'permission denied'. For example, my mouse is jittery and sluggish, so I want to disable polling: sudo echo "options drm_kms_helper poll=N"&...

Bash scripting help

1 answers, 33 views bash scripts
I try to make a bash script that use tor, proxychains, and curl. The first thing I want is to verify tor status and, if tor status is active, run proxychains curl icanhazip.com, then execute ...

Where is the 'line' utility gone that was in /usr/bin/line ? I understand that the bash 'read' builtin is an alternative but I have many uses of line in shell scripts and don't like to touch all ...

For a bash timer i use this code: #!/bin/bash sek=60 echo "60 Seconds Wait!" echo -n "One Moment please " while [ $sek -ge 1 ] do echo -n "$sek " sleep 1 sek=$[$sek-1] done echo echo "ready!" ...

Assuming i have a line that i want to add to a file without opening an editor. How could i append this line alias list='ls -cl --group-directories-first' to this file config.fish

I often see tutorials on the web or posts on this site which make heavy use of the following characters at the command line. Often it seems that they are used for pretty similar purposes. What are the ...

When I open terminal I get these errors: bash: /usr/share/bash-completion/bash_completion: line 171: syntax error near unexpected token `}' bash: /usr/share/bash-completion/bash_completion: line 171: ...

I've installed VS Code on my laptop with Ubuntu 16.04 LTS. I've tried multiple installation method with identical results; mostly recently, I followed the "new" instructions from Cactux here. I've ...

This is a non-standard installation of Ubuntu 18.04, the ELAR Arm based Ubuntu distribution with RockChip support for boards such as the Asus tinkerboard. The Problem, and solution, may not apply to ...

I have a bash script which goes something like this: #!/bin/bash if [ $1 = "--test" ] || [ $1 = "-t" ]; then echo "Testing..." testing="y" else testing="n" echo "Not testing." fi ...

What's the difference between <<, <<< and < < in bash?

I have this code: #!/bin/bash # A simple variable example echo hello and I would like create a function like the The mkdir() function shall create a new directory with name path. The file ...

Within a Bash script, if I run a command within a pipe the special parameter $? will contain the return code of the last command in the pipe. For instance, with an intentionally failing rsync command, ...

I hope I am describing this properly. I have a Griffin Powermate that I use to control the volume of computer. I got it to work via this post (archived site). file:///home/mspringer/Music/Griffin%...

In tutorials and how-to's I often see commands combined. For instance, sudo apt-get update && sudo apt-get install pyrenamer There seem to be four possible connectors: &, &&, || ...

Manually I enter an URL on a browser that calls a page that has a GET function that directly prompts me to save a file. I would like to automate with a cron job on a script this actions: Call the URL ...

Trying to launch VisualWorks launcher. robert@robert-System-Product-Name:~$ /root/vw8.1.1pul/bin/linuxx86_64/vwlinuxx86_64 "~/VisualWorks Projects/launchpad64.im" bash: /root/vw8.1.1pul/bin/...

Related tags

Hot questions

Language

Popular Tags