Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
8
votes
1answer
315 views

How to select (copy) an output in terminal without mouse

It seems like a typical way that you have some output in the terminal and if you want to select certain phrase you use your mouse to copy it, but is there any way to select without using mouse? For ...
0
votes
0answers
24 views

Getting program states from two different terminals and comparing them

I want to run two different instances of a program in two different terminals. and check the variables inside the program if they match all the time or not. What I really want to do here is, do ...
0
votes
0answers
16 views

“Failed to initialize tcti context: 0x1” Error on running command tpm2_nvlist

I have enabled TPM2 from the bios utility of my system. I have installed the tpm2-tools and TSS2 also (on Ubuntu 18.04 LTS). Now when I am trying to execute any commands like tpm2_nvlist an error ...
0
votes
0answers
26 views

Ubuntu and windows both stopped working

I ,first time installed Ubuntu may be I messed up with installation and now I can't boot into my Windows 7 and nor Ubuntu, it only shows a command line interface without GUI .I then started installing ...
1
vote
1answer
30 views

Shortcut to run a single bash command

I frequently have things I need to do in a fresh context to keep from messing up my workflow. Usually I open a fresh terminal, do whatever, and then by the end of the day I have a bunch of single-...
0
votes
0answers
49 views

Enable/disable Daylight Savings Time through command line

Note: By "Disable" daylight savings time, I mean for the system clock to ignore any time changes for daylight savings time (ie, if DST is disabled, then the clock will not "spring forward" an hour in ...
2
votes
1answer
72 views

Uncompress file using bunzip2

I want to decompress a file, I wrote this command: bunzip2 linux-source-4.15.0.tar.bz2 and I got this: bunzip2: Input file linux-source-4.15.0.tar.bz2 is not a normal file. I want to know exactly ...
2
votes
2answers
383 views

How to convert a file with several spaces into a tab-delimited file?

I had file1: MSTRG.10807.1 0.494311896511595 MID 0.423993026403461 2.39379412548345 1.99703339651136 MSTRG.10884.1 0.365770947942799 EARLY 1.46416917664929 1.16816186543633 0....
1
vote
2answers
25 views

change obscure charset or font in ubuntu server console

When I opened a log file in my Ubuntu server, my server font changed to obscure character according to this picture: How can I restore it to the regular font?
2
votes
1answer
47 views

Continue command on a new line

To improve the readability of my code, I want to go to a new line in the code but I do not want the compiler to treat is as a different line of command. How do I do this? python file_a.py file_b.py ...
1
vote
0answers
68 views

Root user access for another user [duplicate]

I am trying to gain root user access to another user so that I can run a command with adding sudo in front of any command. Example: fdisk -l Getting the error message as: fdisk: cannot open /dev/...
1
vote
1answer
35 views

Dual-Mode Terminal or TTY?

You know how you can jump into a full-screen terminal via Ctrl+Alt+F7, but is there a way to have a possible DUAL terminal mode? Something that would provide you with 2 terminals (or more) in a cli ...
1
vote
1answer
30 views

git removal script throwing error: syntax error near unexpected token `('

I've got the below one-liner I use to cleanup my local Git repo. git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D ...
0
votes
2answers
29 views

How to include “Commandline: packagekit role='update-packages'” in a sed command?

I used cat /var/log/apt/history.log > ~/Desktop/allhistory.log && zcat /var/log/apt/history.log*gz >> ~/Desktop/allhistory.log to create ~/Desktop/allhistory.log. I can run sed -...
0
votes
1answer
34 views

change a name of a file in a script

I'm new in bash programming and i like playing around a little bit. I'm trying to execute this script #!/bin/bash echo "Hello there, i am a little script so you can change a number of txt file ...
0
votes
1answer
34 views

What will the workflow be if we execute the scripts as follows

What will the workflow be if we execute the scripts as follows: script1 & script2 & script3 script4 I need to run the script3/4 after completion of script 1/2.
9
votes
2answers
2k views

How can I fix the dull colors I am getting in Ubuntu 19.04 Terminal?

I've just recently switched to Ubuntu 19.04 and I am now getting dull colors in terminal but only outside of programs: In comparison you can see the vivid colors I am used to when I use ranger: I ...
-1
votes
0answers
40 views

Accidentally pasted java code in terminal, machine froze

I thought I had filename on clipboard when it actually was java code. I accidentally pasted java code in terminal and trying to figure out what might have happened and if there is any other damage ...
1
vote
2answers
23 views

Shell how to print an array of elements in pairs of ranges with comma and hyphen

I have an array of an UNKNOWN number of elements that i want to print in this format: item1-item2,item3-item4,item5-item6... forexample: if myarray contains these element: 0 9 11 20 22 31 33 42 I ...
1
vote
3answers
59 views

Different behavior of unset vs. empty LESS environment variable?

I wanted to change the default behavior of the less command, so I added the following to ~/.profile: LESS="$LESS -x4" export LESS However, the mere presence of a set LESS environment variable seems ...
0
votes
1answer
39 views

Changed Commands in new Versions

How can I found out a changed Commandin for new Version.... As you now the command are diffrent from Version to another and if I want to install for example (Sudo apt-get install php7.0-mcrypt mysql-...
1
vote
0answers
16 views

What does 'c' stand for in ls -ld on device files? [duplicate]

I was wondering what 'c' stands for in the below command result. rohith@rohith-pc:~$ ls -ld /dev/null crw-rw-rw- 1 root root 1, 3 Jul 8 06:31 /dev/null rohith@rohith-pc:~$ I could see that this '...
4
votes
4answers
545 views

How I can monitor for new files in a directory and drop a mail if files are not added every 30 mins?

I'm running Ubuntu 14.04 and I want to monitor a folder and drop a mail if new files are not added every 30 mins. I referred below as well. How I can monitor new files in a directory and move/rename ...
12
votes
1answer
1k views

Is there a way I can open the Windows 10 Ubuntu bash without running the ~/.bashrc script?

I was editing the bashrc script in my Windows 10 Ubuntu Bash and I made a mistake while editing the script. Now bash exits immediately upon opening it. Is there a way for me to open Bash without ...
1
vote
0answers
41 views

Log message to database whenever an email arrives

Does anyone have a script that will log a message to a database anytime an email arrives? I'm referring to a native imap server running on ubuntu. I'd like to log a message anytime any email arrives ...
1
vote
1answer
35 views

Ubuntu server log viewer cli

Does anyone have any recommendation of an CLI tool for ubuntu that works as a log viewer? I know you can do like sudo cat /var/log/mail.log to read that specific log file. But maybe there is a tool ...
1
vote
1answer
25 views

Sourcing Environments on Startup

I am new Ubuntu user working Robot Operating System on 16.04 LTS version. I installed ROS using their official ROS-Wiki instructions. Every time I need to run an ROS program I need to source the ROS ...
0
votes
1answer
79 views

Run command in next gnome-terminal tab

I want to be able to open a new terminal tab in the current terminal window and run a command in the new terminal tab from a script. Note that I don't want to open an entirely new terminal window, ...
0
votes
2answers
65 views

Auto compile alias in .bashrc

How do I create an alias in my .bashrc file so that I can compile my C++ program without inputting this much longer command: g++ -o filename filename.cpp Here the file name is variable.
0
votes
0answers
63 views

How to change terminal screen size/resolution on Ubuntu 19.04 Server with VirtualBox? [duplicate]

I installed Ubuntu Server 19.04 from VirtualBox on Windows Host. I have a terminal screen 800x600. VirtualBox does not provide me an option to change resolution. How do I change the terminal ...
0
votes
1answer
60 views

chmod does nothing when i try to install a sh file

I'm trying to install the poweriso sh file (along with other sh files) onto my system, but it doesn't seem to work ( the outcome is the same on all sh files). I did some research on how to install sh ...
1
vote
0answers
35 views

sudo permission denied on nmcli : ubuntu server 64 raspberry pi 3

I have freshly installed and updated ubuntu on raspberry pi 3. Neither sudo ls nor sudo apt-get install pose any problem, but executing: sudo nmcli device status gives: Error: Could not create ...
0
votes
0answers
41 views

Deleting folder completely, but it comes back

I have this folder in Ubuntu 18.04 that I completely removed. sudo rm -rf folder_name It has been deleted, but after a while, the folder comes back, but only with the .cache directory in the folder. ...
0
votes
1answer
29 views

vncserver won't run in a shell script executed with sudo

I have a shell script that installs several programs with sudo apt-get then opens vncserver, then installs more stuff. This works: #!/bin/sh vncserver >./my_script.sh But this does not work: #!...
1
vote
0answers
18 views

How to run a program and pass parameters through a shell scribt in ubuntu [duplicate]

I want to run vncserver in terminal, to automate it with several other commands I've put it inside a shell script. However, when you call vncserver for the first time, it asks you to set a password. ...
0
votes
1answer
57 views

How can I, in Terminal use Sublime Text to open a remote directory mounted by Nautilus?

I mounted a remote server's drive through Nautilus. Login as ubuntu(server account). Local user id is tianhe. I want to use sublime text CLI command (subl file_to_open) to open files on remote server....
3
votes
2answers
101 views

How to delete multiple process id of a single process?

I'm using the following code to kill all the PID's of a certain process, but its not working as expected. pgrep -f <processname> kill -9 $(pgrep -f <processname>) when there are more ...
0
votes
1answer
41 views

How to mv files one by one?

When mv is used between different storages, it first copies all files and then unlinks the source. How to mv files one by one, so that each file is unlinked after being copied, and the folder ...
0
votes
1answer
541 views

How do I fix gnome-terminal

I installed termite and set it as my default terminal using sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/termite 60 but decided I prefer the ...
0
votes
0answers
12 views

only displaying a webpage on 1 of two monitors

basically, i have three linux machines in a datacenter. I'd like to monitor these over netdata. My experience with Windows is better, though i do have a ubuntu machine running Plex and some other ...
2
votes
0answers
98 views

I can't player videos, run the file manager and the terminal after the update at 1 July

Here is my system information: sysinfo At July 1, there was a system message pop up reminding me to update some packages and drivers and I clicked yes. Unfortunately, after the update was finished ...
0
votes
0answers
24 views

Customizing and Automating Terminator Startup

The First Part Every time I boot my Laptop I manually open Terminator with two tabs each having three horizontal terminals. My Solution To The First Part So far I have automated the First Part ...
0
votes
0answers
62 views

Image size mysteriously becomes 0 bytes after renaming

I renamed some jpeg image files through command line and all went perfect except one thing that some images do not have thumb nail and shows 0 bytes on checking their properties but are still getting ...
0
votes
1answer
43 views

UBUNTU 16.04.6 not showing Dashboard, sidebars and menu bars

I am a regular user of Ubuntu 16.04.6. Recently, I was trying to install python3.6 and set this as default. But due some other package I had to remove this version. I uninstalled python3.6 and set ...
0
votes
0answers
36 views

CTRL+C for intr not working in terminal, only CTRL+ALT+C

On an Ubuntu 16.04 virtual machine, just installed gdm. For whatever reason CTRLC does not raise an intr in terminal. I instead have to use CTRLALTC. This was not happening before I installed gdm. ...
0
votes
0answers
31 views

How can I run executable in a different folder with a bash script?

I have a program, a.out, that will be set up in some sequence of folders, each folder gets an a.out and will produce some results in each folder. I am trying to execute these same programs in parallel....
0
votes
2answers
38 views

Is it possible to unzip documents into a directory which is created on the fly in a single command?

How can I achieve something like the following? unzip ./zipped_docs.zip ./new_folder | mkdir ./new_folder Or mkdir ./new_folder | unzip ./zipped_docs.zip ./new_folder I even tried mkdir ./...
1
vote
1answer
53 views

Why do I get a command not found message when I open a terminal?

When I run a new terminal by pressing Ctrl+Alt+T, it shows this text: Команда «rbenv» не знайдена, але може бути встановлена ​​з: sudo apt install rbenv How do I fix the problem, so that message no ...
0
votes
0answers
25 views

How to recover a deleted file from a remote server?

I deleted a file from a remote server and have no idea how to recover that. I don't have access to the system and can only use it through the terminal(via ssh).
1
vote
2answers
54 views

How to install perf on Ubuntu 18.04?

I have tried to install perf using sudo apt-get install linux-tools-$(uname -r) linux-tools-generic It gives an error saying: Reading package lists... Done Building dependency tree Reading state ...