Questions tagged [command-line]

Questions about using the command-line interface (CLI).

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

run batch files with setsid

I want to run many tasks which are defined is a batch file, for example task.sh for i in 1 2 3 4 5 do setsid python main.py 1>data/${i}_a.log 2>&1 sleep 3 done echo "OK 1" for i in ...
1
vote
0answers
13 views

How to open Jupyter Notebook in command line with 'jn' instead of 'jupyter notebook' [duplicate]

I want to create a shortcut in command line to open jupyter notebook to avoid typing long command. also i am curios why 'TAB' key autocomplete 'jupyter' but not 'notebook' when i type jupyter notebook ...
2
votes
1answer
39 views

Inserting #' to a configuration file using sed

I'm trying to use sed to insert a # to a configuration file. I've tried: sed 's/33/#' /path/to/file But get the output sed: -e expression #1, char 6: unterminated `s' command I've also tried sed ...
0
votes
1answer
32 views

Software installation problem: cannot adding path to /usr/local/bin

I am currently installing a software in a local directory(/some/local/directory/bin/). I tried to copy it into the usr/local/bin/ but I am not allowed. I am wondering that how can I execute the ...
1
vote
1answer
27 views

terminal - count how many types of (file) extensions exist with their associated files in current directory

I've about 0.1 million images in a directory with all kinds of extensions (gif, jpeg, png, tiff, etc). Now I want to find out how many types (of extensions) are there in the current directory, ...
0
votes
0answers
25 views

Compare content of 2 files using diff - no such file or directory problem

May I know how can I compare content of two files? I tried these codes below but I get this message: sh: diff: No such file or directory. The commands that I tried are: plink.exe 10.3.0.121 -l ...
-5
votes
0answers
26 views

All day long i couldnt install a single software in linuxmint [on hold]

so basically guys , i installed linuxmint cinnamon 19.1 today first time using linux ever and i liked it so much except i couldnt install any software i tried snaps but in linuxmint there's no gnome ...
0
votes
1answer
41 views

Why can I not install auto-apt?

OS: Ubuntu 18.04 I was looking at the Ubuntu documentation on how to install auto-apt. However, when I run apt-cache show auto-apt I get N: Unable to locate package auto-apt E: No packages found ...
2
votes
2answers
43 views

/usr/bin/rename: Argument list too long

I'm trying to rename a bunch of files and folders. I tried this command rename 's/test/test2/' but I got unable to execute /usr/bin/rename: Argument list too long I searched a lot and tried ...
0
votes
0answers
27 views

How to execute Alt + F2 + r + Return (Gnome Shell Reset) through the Terminal

I'm trying to automate the installation of a Gnome Tweaks extension (Dash to Panel) and, at the end, it requires me to restart the Gnome Shell through Alt + F2 + r + Return (I think that Gnome Tweaks ...
0
votes
0answers
41 views

Date: Invalid date [on hold]

I keep on getting this error everytime I run csh script date: invalid date ‘2D1B/E1//S AS:/D:AT’ ... date: invalid date ‘/nisa/3E - 1 day’ date: invalid date ‘/nisa/3E + 1 day’ Can someone please ...
0
votes
0answers
35 views

Compiling ffmpeg for android

I am trying to compile ffmpeg for android. I have followed the steps in the tutorial. Here's the link to the same https://yesimroy.gitbooks.io/android-note/content/compile_ffmpeg_for_android.html ...
1
vote
0answers
36 views

youtube-dl: ERROR: This video is not available… Which video?

When using youtube-dl version 2019.07.16, if I run the following command: $ youtube-dl --get-id https://youtube.com/user/youtube_channel I will sometimes get an output like this example: dIJxA-...
1
vote
0answers
43 views

bash help (ubuntu)

I made a script that has an update command running first for example sudo apt -y update I need to make sure that if SYSTEM updates are available , the script will ask me if i want to update so ...
0
votes
1answer
27 views

Is it possible to identify windows using regular expressions in xdotool?

OS: Ubuntu 18.04 Say I have the following five open windows with mozilla in their title: $ wmctrl -lx 0x03e00018 0 Navigator.Firefox kububb Ubuntu Manpage: xdotool - command-line X11 automation ...
4
votes
2answers
97 views

Copying directories in linux only if it contains the specified file

I need to make a copy of all the folders under /parent (into a new location) but only if it has 123.dat - in which case I need to copy the folder too, but none of the other files it contains. So that ...
-1
votes
0answers
25 views

Make a list of things we need to learn (Linux) [duplicate]

For those of us who are learning Linux, we need to create a list of things to test our knowledge. To determine how proficient we are at Linux and what we need to know next. What should be in this ...
2
votes
4answers
235 views

How to extract interesting piece of output in bash

My output of command is like: File Size : 23 kB File Size : 9.8 kB File Size : 9 kB File Size : 128 kB File ...
3
votes
1answer
65 views

How to reboot system if specific directory modified as a systemd service

I'm trying to create systemd service to reboot device. When hello.txt file content or file modified, system needs to reboot. I try to achieve but I don't know rebooting indefinitely. Here is my ...
1
vote
1answer
55 views

Environment variables of current process

I'm trying to find the environment variables of a currently running process. Let the executable be test. What I'm doing: ./test // first run test Inside the program I have a print statement doing ...
0
votes
1answer
70 views

Trying to run a script in a new terminal tab from a running script

I'm kind of confused, I thought doing something like this would work : #!/bin/bash wget https://myscript.sh chmod +x myscript.sh exec gnome-terminal --tab --active --title="my title" -- myscript.sh ...
1
vote
0answers
26 views

TMUX NewSession problem with php page

I have a problem, I have a garry's mod server wich i start with this command: ./gmodserver start In user gmodserver I'm trying to make a script wich i can execute with a php page for reboot my gmod ...
0
votes
0answers
41 views

How do I use a text editor to modify PHP files? [duplicate]

I'm new to both Ubuntu and PHP. I have an Ubuntu 18.04 virtual machine with PHP. I've successfully installed php, and been able to make and run some basic php programs in the command line terminal, ...
0
votes
0answers
37 views

System recovery: can’t manipulate encrypted files

Something has used up all the disk space on my home directory and caused my computer to freeze up. I tried to reboot and the system would not do so, and I then booted into recovery mode. Using the ...
0
votes
1answer
27 views

Access python os.environ var in virtualenv with sudo?

I am working on a django project where I have to keep secrete information to python's os.environ. by following below link http://barkas.com/2016/set-environment-variables-activating-virtualenv/ code ...
0
votes
1answer
39 views

Alsamixer finding “item” by command line?

I have 3 playback devices: TV (HDMI), Headphones, Speakers TV uses the GPU soundcard through HDMI, Headphone and Speakers use integrated Mainboard sound. In the following alsamixer screenshot, you ...
0
votes
0answers
14 views

“jobs” doesn't list nohup command after relogging

I'm trying to run a program that takes a while to execute and then log off. I believe I should be able to do this with following commands: nohup [the command I'm running] & jobs #the first ...
0
votes
0answers
13 views

Garbled characters in remote ssh terminal connecting to Ubuntu host

Connecting to Ubuntu 18.04 from several different remote OSs through SSH produces some strange displays when running programs such as nmon, and wavemon (amongst others). Both of said programs display ...
4
votes
1answer
124 views

Use chown -R while excluding one or two files

How can I use chown -R but exclude one or two files? I periodically need to run sudo chown -R www-data:www-data * and sudo chown -R ubuntu:ubuntu * But I'd like to exclude one or two files from ...
3
votes
1answer
141 views

How to check if a new username is a system user?

I want to create a script that change a username. I want to check if the user is not a system user. My idea is to check /etc/passwd and pick only users with an ID between 1000 and 60000 and users that ...
-1
votes
2answers
36 views

Grep and Regex: filter subdomains in a file

First of all sorry I should learn some grep and regex instead of asking that question but I have a little shortage of time for now. And I am definitely going to learn egrep eventually. So here is the ...
-2
votes
0answers
37 views

How to automate the below code, so that it will perform the same operation on all the folders with the naming convention log_job_*?

I have a series of folders which have process.log files with the naming convention log_job_*. What I have done so far: I wrote some code which does the following: Enters into one folder log_job_123....
2
votes
1answer
37 views

bash startup variable expression

I have the idea that I would like to add an environment variable ("waitTillReady") to my ~/.bashrc file, such that instead of doing this: while [ "$(pidof -s make)" -o "$(pidof -s gcc)" -o "$(pidof -...
0
votes
0answers
16 views

Browsh on a VSphere VM is unreadable

I have recently installed Browsh on a VM running on top of Vsphere. I am connecting to the VM using the VSphere built-in console viewer and I am trying to use Browsh to access some websites. The ...
0
votes
0answers
19 views

Creating desktop launcher for jupyter-notebook, but it is inside a python virtual environment

Like many other developers, I always follow this routine when I want to launch the jupyter notebooks that run in my repository (with a pipenv virtual environment): cd /path/to/your/repository pipenv ...
1
vote
0answers
16 views

Command line: program freezes, starts again with user input

I am running a c++ programm on ubuntu, which periodically executes python scripts for long time measurement purposes. My programm takes a photo every 10 seconds and then evaluates the data. But after ...
3
votes
1answer
102 views

How to subtract two time stamps along with their dates in bash?

I have a two variables : A= 04.07.2019 23:29:40 and B= 05.07.2019 01:15:52, I want to perform a arithmetic operation C = A - B using bash. Can some one help me in converting them into integers. In ...
0
votes
2answers
40 views

How to use grep to match a string with spaces in it?

Can anyone help me with this: I am trying to extract a time stamp, by matching a string. For this am using combination of grep/awk commands. As the sting has 4 spces before [1] and one after, am ...
0
votes
1answer
66 views

Suddenly Unable to Launch Terminal

I am using Ubuntu 16.04 and everything had been working fine with the terminal until very recently but now the shortcut (CTRL+ALT+T) and clicking on the terminal from the application menu do nothing. ...
0
votes
0answers
37 views

Can't install kivy with ppa [on hold]

i am trying to install kivy for a couple of days now. Every time i trying there is a problem. I have searched multiple sites and tried to solve it but it seems i messed up and there is now a bigger ...
0
votes
1answer
34 views

Change default input answer in Terminal

While installing VMware Tools. After running command sudo ./vmware-install.pl -d , it shows a message about the availability of open vm tools and asks if you still want to install vmware tools and ...
10
votes
6answers
2k views

How to remove the first colon ':' from a timestamp?

I am new to programming!! Can anyone help to remove the : at the first position in a timestamp: :29.06.2019 23:03:17 Presently I am trying to do it using awk/cut commands as shown below: TDS="$(...
2
votes
1answer
37 views

bin/bash: bad interpreter: No such file or directory

I just shifted from Windows to Linux (Ubuntu 18.04)...and following a tutorial to learn bash scripting... I wrote a simple shell script #!bin/bash echo "Hello World" but when I tried to run it ...
0
votes
3answers
67 views

How to get ls in "select * in *?

I want to program a script, which helps me installing thinks. ( I program it for bash exercises) I want to have a menu with "select option in options" #!/bin/bash download="~/Downloads/" options='ls -...
0
votes
0answers
30 views

Failed to fetch curl when trying to install, 404 Not Found

Attempting to revert a Chromebox with Windows 10 on it back to ChromeOS, using Ubuntu on a live boot to run a custom script to update the firmware. Basically, in order to run this command: cd ~; curl ...
-1
votes
1answer
46 views

How to edit a file that has a space in its name? [duplicate]

I'm on Ubuntu 18.04. If I go into my home directory and right-click and select "new document" and then "empty document", a new file appears called "Untitled Document". Now I want to edit what's in ...
2
votes
1answer
38 views

xargs: invalid option — 'o'

I was trying to execute this command to fix yet another error (Unable to use a TTY - input is not a terminal or the right kind of file): kubectl get pods -n foobar | grep baz | awk '{print $1}' | ...
1
vote
1answer
44 views

Terminal does not open in Ubuntu 16.04 with CTRL-ALT-T

I am using Ubuntu 16.04, and for some unknown reason I am not able to open a terminal with CTRL + ALT + T. When I press these keys, nothing happens. I also tried to start a terminal from Dash, but ...
0
votes
0answers
28 views

Tools to debug ACPI problems

I came across this excellent paper written by Intel: How to achieve S0ix states in Linux* It contains a nifty little bash script: #!/bin/bash cd /var/tmp/ acpidump -b iasl -d *.dat lp=$(grep "Low ...
0
votes
0answers
13 views

“E: Malformed line 1 in source list /etc/apt/sources.list.d/lutris.list (type)” “E: The list of sources could not be read.” [duplicate]

Today I tried to install Lutris by command(big mistake) and then it not worked,after this everytime I try to install someting or do a simple "sudo apt-get update" in terminal this message shows up to ...