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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
2k views

How to execute a bash script before shutdown using systemd?

I have a executable bash script (.bash_history_cleaner) which cleans my bash history #!/bin/bash cat /dev/null > ~/.bash_history && history -c && exit I want to execute this ...
Eka's user avatar
  • 2,967
0 votes
2 answers
2k views

File / Folder navigation problem with the 'cd' command [duplicate]

I used to use this command cd /Foldername to navigate the folder. But I am facing a problem with this now I need to use this command cd ~/foldername for navigating. Please have a look on the screen ...
Zer01ne's user avatar
1 vote
1 answer
604 views

Surpress command line questions during package installation

I have an Ubuntu 16.04 based appliance in which packages from the public repository are installed. But not directly using the public repository. Instead an update server is used which downloads the ...
Grizzly's user avatar
  • 21
0 votes
0 answers
180 views

How to reset the repositories present in "Other Software" tab of "Software and Updates" in Ubuntu 18.04?

I was googling out steps to update MySQL from 5 to 8 version. Without further thinking I inserted these commands in terminal: sudo apt-key adv --keyserver keyserver.ubuntu.com The keyserver of ...
HV Sharma's user avatar
  • 101
1 vote
1 answer
44 views

need help updating laptop [duplicate]

So I tried to install encryption third party software and I messed up. I keep getting this message when trying you sudo apt-get update N: Ignoring file 'medibuntu.list.save.4' in directory '/etc/apt/...
Skate Lurker's user avatar
0 votes
1 answer
47 views

My command will not run, even though it is recognised as an executable

Here is the command I have typed in order. I expect it to run my "simple hello work" program. vagrant@vagrant-ubuntu-trusty-64:~$ ls filename.zip tester vagrant@vagrant-ubuntu-trusty-64:~$ ...
user3755946's user avatar
0 votes
1 answer
299 views

Trouble running command on Terminator launch

According to the Terminator man page, I can use the --command flag when running the terminator command to run a command when the terminal window opens. However, I can't seem to get it working. I've ...
APixel Visuals's user avatar
0 votes
0 answers
97 views

My Ubuntu 18.10 does not display the GUI login, but works only in command line mode

I have logged in into my Ubuntu using terminal login itself. And I tried out the shortcuts Ctrl+Alt+F3 and Ctrl+Alt+F7 which I found that it was to switch from GUI to command line mode.
vignesh_md's user avatar
0 votes
0 answers
988 views

Can't execute shell script from ssh command

I have a script that will transfer a shell script from one server to another. The transferred script will change password for my user. I was able to transfer the script but it cannot execute it using ...
kerminaxcx's user avatar
1 vote
0 answers
65 views

how to prevent grep from printing the filename every time there is a match [duplicate]

As I go through multiples files, I want grep to print the filename of the first match. For example: grep -nHC 2 "show reload" wgltva-811sono1-dc* Right now, I am searching for a string in multiple ...
Angel's user avatar
  • 11
0 votes
1 answer
1k views

Zsh doesn't see some CLI

I've just installed Zsh / oh-my-zsh to apply some style and helpful functions to my terminal but it isn't working well. Here what I did: sudo apt install zsh and then I cloned oh-my-zsh with: git ...
Gabriel Gambarra's user avatar
0 votes
0 answers
431 views

Move folder and file name to metadata, batch rename files

I'm very much a novice at programming on the command line so please forgive me asking for very basic help. I want to take a folder with very many subfolders, add the subfolders and file names to ...
Nathan Tankus's user avatar
1 vote
0 answers
719 views

How to persist a tab that is opened via `gnome-terminal --tab` after closing process

I currently have a .sh script that opens 3 new tabs for me and runs a task inside that terminal window: gnome-terminal --working-directory=/home/hutber/site/refdata_service --tab -e "yarn start:dev" -...
Jamie Hutber's user avatar
7 votes
2 answers
7k views

What is the difference between cat and tee?

I was playing around with the Apache php.ini and got it so when I send emails with a PHP file that has the mail() function it will save the email on my computer, which is good for testing and for web ...
Peter's user avatar
  • 113
8 votes
4 answers
2k views

How do I set an alias to a terminal line?

I want to easily set an alias git-go to this terminal line: git commit -m "init "; git push; git status So when I enter git-go this line should enter. How can I do that? The answers I seen ...
Philip Rego's user avatar
9 votes
2 answers
3k views

Jump to beginning of output of last command

This is a question I've had for around a decade now and I've never found an answer. To make it specific though, I'll ask in the context of my current environment. On Ubuntu 16.04, using the gnome ...
Apollys supports Monica's user avatar
0 votes
1 answer
179 views

Resize image from command line to 1024x576

I need to convert images down to 1024x576 using the command line. I have Gimp, VLC, and Inkscape, on Ubuntu MATE 18.04. Thanks.
fixit7's user avatar
  • 3,127
4 votes
1 answer
7k views

Terminal cyrillic problem

When I ran the xclock command in the terminal, I always received the following warning: Warning: Missing charsets in String to FontSet conversion I edited my ~/.bashrc file added the following line ...
fedotsoldier's user avatar
1 vote
2 answers
269 views

Configure key shortcuts in context menu of ubuntu terminal

Currently right click menu in terminal has terribly defaults in a sense that rightclick p does not cause paste since both Preferences and Paste have that as shortcut(underlined letter in command name)....
NoSenseEtAl's user avatar
6 votes
3 answers
13k views

Passing arguments to a script

I am taking the Linux Essentials class and was doing well until I hit the scripting chapter. I simply do not understand these concepts. Wondering if someone can break the following down into ultra ...
Micahmann's user avatar
0 votes
0 answers
256 views

Multiple alias commands for NordVpn - disconnect from vpn && restart internet

I am using NordVPN and for it a dedicated terminal program. I have made two .desktop alias to connect to vpn and to disconect. Fist one is to connect to US server: [Desktop Entry] Name=NordVPN c us ...
user avatar
2 votes
0 answers
930 views

Redirect output of a startup script to terminal

I have a shell script init.sh that invokes a javascript script app.js like this: #!/bin/sh node app.js In the js script there are some console.log that i would like to see on the terminal. If I ...
jon snow's user avatar
0 votes
1 answer
258 views

cd-command not operating even with capitalized letters used in bash

Hey everyone I need help with my cd command as it is not working. I typed: cd Downloads and it won't work, I'm trying to install something and it's giving me this as a response. -bash: cd: ...
raine c's user avatar
  • 11
2 votes
2 answers
341 views

How to compress 3000 images in batches of 50

I have a folder with over 3000 images, I want to compress 50 of them individually and store them in tar files. The images are not serially named. How to use write a bash script which does this job?
Pradeep BV's user avatar
24 votes
3 answers
8k views

What does the hyphen "-" mean in "tar xzf -"?

When try to install dropbox from command line, I read the commands cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - what does - mean here? is it previous ...
Wizard's user avatar
  • 2,891
0 votes
1 answer
309 views

How to use this command line in Ubuntu

I ask my question in the form of an example ... I have a folder containing several subfolders that are as follows Main folder==)Got, Vikings, etc. In each one there is videos with their corresponding ...
Hadi's user avatar
  • 3
0 votes
1 answer
76 views

Is there a particular ID given to the terminals(Command Prompt) i opened in Linux Machine

I have opened 2 or more terminals opened in Linux system. I want to differentiate them... Is there is a way to differentiate them???
Raghavendra Phayde's user avatar
0 votes
1 answer
449 views

Magic file does not produces wanted results

I got two files: $cat myMagic 20 string TEST ThisIsTestType $cat testFile TEST i am test file from inside Both files are in same directory.I run: $file testFile testFile: ...
ph7's user avatar
  • 325
22 votes
1 answer
43k views

Is it possible to change the permissions for the symbolic link?

I am trying to change the permissions for the symbolic link. As how you can see in the image, the soft link has 777 permissions, but i would like to change that. I tried to change that by: chmod ...
ph7's user avatar
  • 325
1 vote
1 answer
840 views

Nautilus and Terminal refuse to run on Ubuntu 19.04 (up-to-date as of 14 June 2019)

After clicking on them, it loads for a while then nothing happens. Currently using Tilda and Dolphin as I do not have access to my filesystem and the terminal. Somehow Nautilus runs when I run it ...
Abdul Mun'em Chung's user avatar
2 votes
0 answers
89 views

how to customize ubuntu terminal shortcut of deleting a word backward and forward

this may seem as a duplicate question, but I couldn't find a solution in others, I am using Ubuntu 18.04 for now, and the terminal shortcut of deleting a word backward and forward is Alt+← and Alt+d, ...
mlee's user avatar
  • 21
0 votes
1 answer
1k views

Run two servers simultanually from bash script

I have two servers that I need to run with these commands: cd /home/hadoop/apache-hive-3.1.1-bin/ sudo hiveserver2 and sudo /opt/hue/build/env/bin/hue runserver So I putted both commands in a ...
Haha's user avatar
  • 105
1 vote
2 answers
2k views

Transmission won't launch script after download on Ubuntu Server 18.04.2

I am on a completely fresh install. After installation I have only installed Transmission. (transmission-cli transmission-common transmission-daemon) Then I created a file under /var/lib/...
Norbert's user avatar
  • 11
1 vote
1 answer
398 views

How to display number of items in sub-directories from command line

In Ubuntu graphical user-interface, I can list the sub-directories in a directory where one column represents the number of items in these sub-directories. As shown here: Is there a way to get the ...
utengr's user avatar
  • 113
2 votes
2 answers
5k views

automation of shell script to read all its input from a file instead of a keyboard

Suppose I have a shell script which take inputs from keyboard. I want to write all the inputs in a file and then use that file for providing inputs to the script instead of using the keyboard. Is it ...
muntaj hossain's user avatar
2 votes
1 answer
822 views

How do I sort a file based on both letters and numbers?

A file with this content: abc[0] abc[100] abc[101] . . abc[127] abc[19] abc[1] . . abc[9] xyz[0] xyz[100] xyz[101] . . xyz[127] xyz[19] xyz[1] . . xyz[9] I want to retain the ...
user8217644's user avatar
4 votes
2 answers
3k views

Difference between grep -R (uppercase) and -r (lowercase)

If I go into /etc/apache2/ and type grep -rl 'LoadModule php' ./* then I'll only see ./mods-available/php7.0.load. If I change r to R then I'll see ./mods-available/php7.0.load ./mods-enabled/php7.0....
Magnus's user avatar
  • 263
3 votes
1 answer
382 views

how to shift a parameter and throw it entirely from args ls?

I have a script that gets N params. It first parses them (extracts a specific value X), then calls another program with said value: function main() { parse "$@" run "$@" } main "$@" I want ...
CIsForCookies's user avatar
0 votes
1 answer
543 views

Automatically execute script that requires password when I login with my second user

So I am changing all of the question so you can understand my purpose: I have this script.sh: $HADOOP_HOME/sbin/start-dfs.sh $HADOOP_HOME/sbin/start-yarn.sh cd /home/hadoop/apache-hive-3.1.1-bin/ ...
Haha's user avatar
  • 105
3 votes
1 answer
6k views

Why environmental variable returns none in Linux?

In windows to set a new variable = value we can simply add it to the environmental variable. However, in linux, looks a bit tough. this is the procedure which I followed: Open Terminal and write: ...
ElisaFo's user avatar
  • 33
1 vote
1 answer
61 views

What is the best way to rename files and directories recurively on bash?

I am trying to make a script to rename a lot of files and directories in bulk. But I'm having trouble making it move through every file and subfile. My script right now is this #! /bin/bash ...
metichi's user avatar
  • 897
25 votes
5 answers
35k views

Is it possible to install Firefox on Ubuntu with no desktop enviroment?

I want to install firefox on a Ubuntu server that currently has no graphical desktop environment. Is it possible to install some minimal display management tools that will allow me to launch graphical ...
deimos's user avatar
  • 721
2 votes
1 answer
1k views

bash script using espeak only says first word

I am writing a bash script to convert lyrics to audio clips using espeak. The problem is that espeak only says the first word, rather than the line by line that I'm reading. I tried putting the lines ...
j0h's user avatar
  • 14.8k
1 vote
0 answers
320 views

How to get a shell script to open up a python gui on startup

I have a project with a couple Raspberry Pi's. I have created a monitor of sorts that needs to run so long as the pi has power. I Name my program "prodmain.py" But I launch it through an update ...
caleb baker's user avatar
1 vote
1 answer
3k views

How to write a string containing private ssh key to a file?

I am using Azure DevOps for my pipeline. I have a copy of the public and private keys. The public key is already added to the server via the creation process using Terraform. For testing purposes, I ...
IHelpPeople's user avatar
2 votes
1 answer
3k views

How to convert LaTex to PDF using terminal?

I am trying to convert latex file (.tex) file into pdf format. I tried using pdflatex file_name.tex command from the terminal but terminal asks to enter file name again and again. The commands in the ...
MRIDUL SHARMA's user avatar
0 votes
0 answers
211 views

Unable to lock Zip file Ubuntu 18

I am trying to make a locked ZIP folder in Ubuntu 18.04. I followed this post, but it locked the files inside it and not the ZIP folder as a whole. I can open the ZIP folder without providing a ...
RishiC's user avatar
  • 223
1 vote
1 answer
460 views

How to remove "." from a filename in Perl?

I do /(\.[^.]+)$/ in Perl to read the extension of a file, for example Text.txt. How can I remove the . so that the output gonna be Texttxt?
Hawa's user avatar
  • 21
0 votes
1 answer
692 views

How to get write permission for folder and subfolders

In my Visual Studio code on ubuntu 19.04 I have created a folder with some content with a CLI tool called expo. However, my sudo user jonas does not seem to have rights to write to this folder since I ...
Jonas Grønbek's user avatar
0 votes
1 answer
7k views

Services stopped working - exec: tclsh: not found

I am running Security Onion on Ubuntu 16.04. A few of the primary services (SGUIL, PCAP, Snort) stopped working yesterday, 6/9/2019. In the logs of each of these services I find the following entry: ...
Jeff Suchomel's user avatar

1
121 122
123
124 125
457