Questions tagged [command-line]
This tag is for questions that are about using the command-line interface (CLI), including the use of standard command-line tools and shell commands. However, for questions that are specific to each shell (like Bash, ZSH etc.), use the tag of that particular shell as well.
22,811
questions
1
vote
1
answer
874
views
trying to write bash script that sends email with output from two variables ubuntu 18.04
The problem I am having is that the action I am looking for is for sendemail to send myself an email that contains both w output from the ssh user and output from doing an lsof -u on $SSH_USER to see ...
10
votes
4
answers
23k
views
How can SSH work with an if condition?
I have an if statement to calculate files and delete all except the latest three files. But I want to run this command remotely. How can I combine ssh with an if condition?
I tried this but no ...
1
vote
1
answer
218
views
argument not recognized for-loop
I'm new pretty new when it comes to creating scripts in linux (I also don't really know on which terms to use like bash/shell), but I have the following command in a script which I want to execute ...
1
vote
4
answers
5k
views
Is it possible to use grep command nested?
I mean, when I run
dpkg -s thunar | grep "Depends"
it displays all dependencies for thunar file manager. How to run, for example
dpkg -s thunar | grep "Depends" | grep "gtk"
to display only ...
0
votes
0
answers
146
views
App runs in background in launcher but works fine when in terminal
I've installed several programs in Ubuntu (eg. Matlab) and am trying to add them to the Launcher using Alacarte. "matlab" is in my bin path so I can launch the program with GUI in my terminal.
...
3
votes
2
answers
348
views
Use read line to iterate over variables
I have the following files:
$ ls *.png | egrep -i "am|pm"
output-0 11.42.30 AM.png
output-0 5.10.12 PM.png
....
I want to remove them but get this error:
$ ls *.png | egrep -i "am|pm" | while read ...
2
votes
1
answer
8k
views
read input from a file and append that values to variables using shell
I'm trying to write a bash script to read a file as input and append the
values/data in that file into variables and the values of the variables should be updated each iteration based on the input ...
2
votes
0
answers
127
views
upgraded to Ubuntu 18.04 LTS and now there is error found when loading /home/[user]/.profile
My laptop used to have Ubuntu 16.04 LTS. I upgraded it to Ubuntu 18.04 LTS. After upgrading, every time I boot it, it shows this error message:
Error found when loading /home/[user]/.profile:
home/[...
2
votes
1
answer
1k
views
The 'proper' way to get ONLY my eth0 netmask via CLI in Ubuntu 18.04 on VPS?
According to this answer and many other tutorials throughout the web, ifconfig will list lots of fascinating and useful information. And, that seems the standard way to find out stuff like my netmask.
...
0
votes
0
answers
91
views
How to print column number of last character of line in file
I want to print the column number of last character of line. I have a file. So I want to print the column number of last character of line which has highest number in file.
Thanks.
5
votes
2
answers
30k
views
How to move multiple folders to another directory? [duplicate]
How can I move multiple folders into another directory ? For example, I would like to move the folder 000/ 001/ 002/ to train/000/ train/002 train/003. Is there a simple command that I can use like
...
2
votes
3
answers
5k
views
changing individual letter position with bash
If I have a file called text.txt
and it contains one line of text, ijbiaubiu
is it possible to move each letter one space forward or back in the alphabet in order to encrypt it manually, with what I ...
1
vote
1
answer
2k
views
Command not found after setting source in bash script [duplicate]
Following the instructions here, and everything works fine manually. However, when I use the instructions in a bash script, I get rbenv command not found because the source ~/.bashrc didn't execute ...
1
vote
0
answers
3k
views
"dmesg: klogctl failed: Operation not permitted" appears every time terminal is opened
I am experiencing an issue on Kubuntu 18.10 where every time I open any form of terminal (Konsole, Yakuake, Xterm) I receive the message
dmesg: klogctl failed: Operation not permitted
in the ...
0
votes
2
answers
5k
views
Downloading a file in ubuntu from a website with wget
I am trying to download Hadoop from here: http://ftp.heanet.ie/mirrors/www.apache.org/dist/hadoop/common/stable/
It contains the file hadoop-2.9.2.tar.gz which I am trying to access.
The command I am ...
0
votes
1
answer
679
views
close select dialog box after choosing and continue running shell command
Using xfce4-panel in openbox, I managed to add a shell and changed the picture's background with nitrogen.
When I try to add a select dialog box to choose between two methods, random and classic ...
2
votes
0
answers
1k
views
sed append multiple lines with special characters through bash file
Ive been trying to figure this out for a awhile now but need to phone the experts.
sed '/#algoscreens/ a\
'${coinname}'="screen -dmS '${coinname}' bash $STRATUM_DIR/run.sh
'${coinsymbol}.${coinalgo....
0
votes
2
answers
1k
views
Terminal only shows > symbol when I enter this find command [duplicate]
I want to delete all .ppm and .png files under current directory. So after checking some web pages about the usage of "find" command on the Internet, I typed the command below:
find . -type f \( -...
0
votes
2
answers
378
views
How can I launch any application using terminal?
I tried to launch some packages with terminal. If I type teamviewer in terminal in launches but most of the application didn't.
Can anyone be able to help me out? Thanks.
0
votes
2
answers
5k
views
Where, and how, do I install multiple packages stored in a local directory? [duplicate]
I've found several posts about mass installing Linux packages with one command here, here, and here.
Here's my situation. I'm in a 3rd-world country right now with limited internet access. I want to ...
20
votes
2
answers
27k
views
How do I setup SSH key based authentication for GitHub by using ~/.ssh/config file?
I am trying to set up my SSH keys for GitHub and created a new SSH key for the same. I have managed to setup the SSH key but I wish to retain these settings and save them in the configuration file ~/....
2
votes
1
answer
2k
views
zsh: command not found: git-flow
I want to use git-flow on my Ubuntu machine but I am getting zsh: command not found: git-flow
Steps I followed are:
Installed git-flow,
sudo apt-get install git-flow
After installing I use git-...
0
votes
1
answer
1k
views
How can I change $ to > in terminal? [duplicate]
In any terminal there is specific meaning of puneet@Puneet-Ubuntu-PC:~$I want to replace '$' symbol with '>'.
Please guide me How can I make this change.
26
votes
3
answers
194k
views
Can't make new dir with mkdir
When I run
mkdir ../../bin/Release_Linux/Resources
Im getting an error
$ mkdir ../../bin/Release_Linux/Resources
mkdir: cannot create directory ‘../../bin/Release_Linux/Resources’: No such file or ...
3
votes
0
answers
7k
views
How to fix Ubuntu 18.04LTS freezes?
I've installed latest Ubuntu 18.04.1 LTS about a week ago.
All the soft was installed via system menu or Jetbrains repo.
In 2 days appeared freezes - only mouse moves, irresponsive to keyboard, timer ...
0
votes
1
answer
64
views
Deleting all the listed files [duplicate]
I used locate <filename> in order to see where are all the files with <filename>. Is there a command to delete all the files with that <filename>?
For example, I want to delete all ...
0
votes
0
answers
323
views
Ubuntu has no terminal
I originally tried to install 64-bit ubuntu in VirtualBox but it didn't work.
I then tried 32-bit (16.04) and it installed but there is no terminal on the
desktop. Other than that , it looks just like ...
3
votes
3
answers
9k
views
Change Ubuntu Server 18.04 LTS Bionic Console Screen Resolution
Running Ubuntu 18.04 sever on a physical machine or VirtualBox?
Do you need/want to use the full native resolution of your screen? Higher than 640x480 / 800x600?
Then you may be stuck as I've been, ...
0
votes
1
answer
1k
views
Extract only package name without version using awk or sed
cat pkg.temp
ca-certificates-2017.2.14-65.0.1.el6_9.noarch
glusterfs-3.7.9-12.el6.x86_64
glusterfs-api-3.7.9-12.el6.x86_64
glusterfs-api-devel-3.7.9-12.el6.x86_64
glusterfs-client-xlators-3.7.9-12.el6....
2
votes
1
answer
11k
views
file: symbol lookup error: file: undefined symbol: magic_setparam
My file command is broken.
$ file
file: symbol lookup error: file: undefined symbol: magic_setparam
$ which file
/usr/local/bin/file
$ ldd $(which file)
linux-vdso.so.1 (0x00007fffc43fd000)
...
1
vote
1
answer
464
views
VirtualBox does not run after ugrade from Ubuntu 16.04 to 18.04
I have just upgraded my Ubuntu from 16.04 to 18.04.
When I want to run VirtualBox from command line,it does not work. It returns the error:
VirtualBox: Error -610 in supR3HardenedMainInitRuntime!
...
0
votes
1
answer
90
views
How do I revert to normal keyboard?
Im using Ubuntu 64-bit CLI and I must have pressed an odd combination of keys because now instead of normal letters etc I am getting symbols like this
Anyone know how to revert back to normal ...
1
vote
1
answer
387
views
How can I auto-close an urxvt terminal after executing an expect script?
I've written a script to handle quick copying of passwords to the clipboard:
#!/usr/bin/expect -f
spawn -noecho zsh
expect "$ "
send "pass show -c "
interact
exit
This script is launched like this:
...
3
votes
0
answers
932
views
How to force a virtual monitor to be always secondary?
Created a virtual display so VNC can work when there is no physical display:
/usr/share/X11/xorg.conf.d/20-intel.conf:
Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "...
4
votes
2
answers
7k
views
How to change my default terminal to GNOME Terminal rather than Terminator?
I was wondering how I can go back to using the GNOME Terminal as my default terminal in Ubuntu rather than having Terminator as my default. Also, I do not want to uninstall Terminator, I just don't ...
1
vote
1
answer
1k
views
Lubuntu - terminal disappears but is still running
I've added a quick launch section to my panel. I've added some programs and all are working fine so far except the terminal.
I have added the terminal to the quick launch. When I click on it, the ...
8
votes
1
answer
552
views
How do I control when bash auto-completion shows a paged list of completions?
In my previous linux installations the bash auto-completion has always worked without problems. If I wanted to do anything to files, giving a prefix of the filename and pressing tabulator listed all ...
1
vote
1
answer
101
views
copy file from folder in user abc to a root folder [closed]
As user abc, I had wanted to install a "systemrescuecd.iso" on a USB stick. I had made a temporary folder "/tmp/cdrom" (command: mkdir -p /tmp/cdrom). But the command:
mount -o loop,exec /path/to/...
1
vote
3
answers
4k
views
extract substring (filename) with bash/grep/awk/etc
I have a console output process string like this:
plex 24029 33.3 3.4 330284 63656 ? Sl 22:37 6:01 /volume1/@appstore/Plex Media Server/Plex Transcoder -codec:0 mpeg2video -codec:1 ...
0
votes
0
answers
45
views
Which flavour Ubuntu for Ubuntu Console Only? [duplicate]
I'm a Web Developer.
I've got an old Netbook computer.
I want to learn VIM and force myself to use the terminal to create a small NodeJS or Python project and fumble around in the dark with a text-...
0
votes
2
answers
672
views
Bring a cronjob back to foreground
I've set a cronjob to upgrade my ubuntu in /etc/crontab:
0 2 * * 1 root apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1
Now, in ~/upgrade.txt, this line is ...
0
votes
1
answer
597
views
is there a putty replacement that supports diverse colors? (over 4bit) [closed]
putty seems to support only 3bit(8) colors while vim's default colorschemes seem to be 4bit colors. so with only 3bit colors it's sometimes even unreadable. is there any replacement that supports more ...
0
votes
1
answer
7k
views
How do I fix apt-add-repository "no such option: --allow-unauthenticated"? [duplicate]
I'm running 18.04, and I'm attempting to install Wine, which has an unsigned repository. I tried bypassing this by using the --allow-unauthenticated flag, but I get an error
$ sudo apt-add-repository ...
5
votes
2
answers
3k
views
Show tree of directory with files content
I would like to print out in terminal tree like one below:
$ tree -a
.
└── .git
├── branches
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ...
2
votes
1
answer
1k
views
How to sum file sizes using bc and stat
I want to perform bc command on this output in order to get the sum of them.
Command:
stat --format=%s /etc/*.conf | paste -sd "+" -
Output:-
2981+6790+2969+604+346+2584+4781+9+144+34+191+599+973+...
3
votes
1
answer
2k
views
Creating .desktop launcher with QT_SCALE_FACTOR
I'm trying to create a launcher to replace this terminal command:
QT_SCALE_FACTOR=2 /home/cozza/V-PlaySDK/Tools/QtCreator/bin/qtcreator
I created the a .desktop
nano ~/.local/share/applications/...
2
votes
1
answer
474
views
Get NVIDIA information in a friendly way?
I'm writing a TaskManager app for Ubuntu, which has as main goal to show me info about my GPU, and I am looking for a way to get information in a programming friendly way, that means, in a way that I ...
0
votes
0
answers
1k
views
I am trying to downgrade make from 4.1 to 3.81
I downloaded 3.81 file from http://ftp.gnu.org/gnu/make/
after then extracted it & then inside the extracted file I opened terminal but I got errors...
./config
make
sudo make install
After make ...
16
votes
4
answers
10k
views
Invoking GNOME Activities overview from command line
Is there a way to invoke the Activities view of GNOME from the Linux command line? This is what the Super key invokes from GNOME. Once it is shown, I can interact with it as usual using the mouse.
I'...
3
votes
1
answer
1k
views
Does running a bash script as root change the ownership of files to root? [closed]
I know I should just test one of my scripts on a file after making a backup copy, but I'd like to know if it will make any difference, as I have several scripts that perform identical tasks on ...