The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

2
votes
2answers
22 views

How to extract info from console output, between two specific lines?

How can I get the part of a console output, between two specific lines? A dummy example: Command: git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v '^$' Output: 0.1.0 ...
2
votes
1answer
43 views

Login to Skype from terminal or any other way

Please let me know if anybody knows how to login to Skype on Linux Mint from terminal or any other way? I have tried a lot but nothing found. Desktop # ./skype.desktop ./skype.desktop: line 1: ...
0
votes
0answers
23 views

characters stick at the CLI [duplicate]

When I press arrow up to search through the command history, some characters always remain at the beginning of the command line. Does anyone know what's going on ? How can I fix it? for example, I ...
7
votes
2answers
236 views

Is there a shortcut for repeat the second proximate command in bash?

We all know that !! can repeat the last command you do in bash. But sometimes we need to do some operation like $ python test.py $ vim test.py $ python test.py # here is where I need to repeat the ...
13
votes
2answers
980 views

Coloring different sources for tail

I'm watching different logs by tail -q -f /var/log/syslog -f /var/log/fail2ban.log -f /var/log/nginx/error.log How can I have the output of each log colored differently?
1
vote
1answer
34 views

Listing audio files with bit rate in the command line

Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried ls -l but it doesn't work.
1
vote
1answer
68 views

Command-line parameters in bash script not recognised

I use Debian (Raspbian) Wheezy. If this command line works fine: smsd -c sms/out -i 60 -0 -f sms/smsd.log and this alias also works fine: bsmsd='smsd -c sms/out -i 60 -0 -f sms/smsd.log' then ...
4
votes
3answers
45 views

Is it possible to view the list of file names of a zip file which is inside another zip file?

I know I can use unzip -l file.zip to view the file list of a zip file. But a got a zip file inside another zip file. I tried unzip -l file.zip/sub_file.zip, but failed. Is it possible to view the ...
2
votes
2answers
68 views

How parse a log file for a string, and when found search backwards for another string

I use the following command to parse a log file for a particular string. Then I search backwards in the log to find the data I really want. The problem as in the example below, I am only going back ...
4
votes
1answer
234 views

How to rollback network configuration changes done over SSH in case of failure?

I'm about to change iptables configuration and interface speed and duplex settings over SSH. What are the possibilities to rollback the changes in case of host becomes unreachable? I guess simple: ip ...
2
votes
3answers
36 views

Convert a number of seconds elapsed to date from arbitrary start date

I want to convert a particular amount of seconds to a date. In my case the it's the number of seconds elapsed since 1st of January 0001. If it were for seconds elapsed from epoch it would be easy: $ ...
3
votes
3answers
81 views

How can I delete text before a delimiter in Linux

I need to delete text from a line before delimiter. For example: (123434): hello::{apple,orange,mango}. I need to delete text before first :. i.e. (123434). Is there any command in linux to ...
4
votes
3answers
252 views

How to pass each line of a text file as an argument to a command?

I'm looking to write a script that takes a .txt filename as an argument, reads the file line by line, and passes each line to a command. For example, it runs command --option "LINE 1", then command ...
4
votes
2answers
155 views

Change user info on the command line

I have made a user in Mint 16 but want to change its first and last name without deleting it and starting from scratch. I know how to do it with a GUI but I want to know the terminal command ...
0
votes
1answer
32 views

Less command change color of “~” and “(END)”?

How do I change the color of the "~" characters that go along the edge of a Less command output. And how to change the color "(END)" at the bottom?
0
votes
1answer
38 views

How to start a cron task?

It sounds really simple, but many times I was stuck at the beginning of learning a new command. The tutorial writer think it's natural to start, but it's not. This is the tutorial I've been reading: ...
0
votes
3answers
96 views

Mounting /dev/dvd /media on VirtualBox

I have installed Scientific Linux on VirtualBox and I am trying to follow some exercises on a book I picked up. The first thing I need to do is: mount /dev/dvd /media But when I do that, I get ...
6
votes
2answers
175 views

How many commands can be queued up with control operators?

I have been reading up on control operators, and I was wondering if there was a limit to how many commands you could line up with control operators, such as ||, && and ;. In addition, is ...
1
vote
3answers
85 views

How to disable a shell keyword?

Using enable builtin command we can disable a shell builtin command, for example echo, as follow: enable -n echo But how can we disable a shell keyword like time? If we try: enable -n time we ...
3
votes
4answers
257 views

Make many subdirectories at once

Suppose I have a directory /, and it contains many directories /mydir, /hisdir, /herdir, and each of those need to have a similar structure. For each directory in /, there needs to be a directory doc ...
1
vote
2answers
85 views

Pass a command to ROOT from a shell script and having it stay open

I am writing a bash script to perform some analysis using the program ROOT. I want to run some initial command to load the result of the analysis, then continue using ROOT interactively. The analysis ...
2
votes
2answers
30 views

Select a range of files after sorting them

One thing I notice slower for me if I switch from using a GUI file manager to CLI is: In a GUI file manager, I can quickly select a subset of files under a dir by, first sorting them according to ...
1
vote
3answers
43 views

Command to 're-apply' previous command?

Is there an easy way to re-apply a previous command to a new command line entry? Say I typed in chmod u+r,g+x file.txt but forgot the sudo. Could I simply type sudo <some easy symbol>'? ...
2
votes
1answer
58 views

Memory buffer in a bash script

I have recently finished a script that will ask for a hostname and automatically take the argument of the function and ssh into one of my work servers. Here is a copy of my script: #!/bin/bash echo ...
2
votes
2answers
43 views

Copy a folder and its content to all Nginx vhosts host

I am interested to know if a single command line that would allow me to recursively copy a folder to all of our NGINX Virtual Host htdocs folders: I need to copy that folder to all hosts located in ...
16
votes
2answers
461 views

How to retrieve lost aliases?

Let me start by saying I know this was dumb. Time and Linux make fools of us all. I made an echo command to my .bash_aliases file and erased all of my aliases, except the test alias. However, I ...
1
vote
3answers
56 views

How to rename file using substring of the same file name [duplicate]

I want to rename my file with its substring.Because unfortunately renamed all the files in my server. Now I want to remove suffix( .gz) of all the files including files in subdirectories also. Below ...
0
votes
3answers
47 views

How do you view a sql.gz file as plain text SQL from the command line?

How do you view a sql.gz file as plain text SQL from the command line? I want to read the SQL statements stored in a .sql.gz file, from the command line on the server. I've tried tar -xzvf, but get ...
-1
votes
1answer
38 views

How to have back the command prompt after calling an application [duplicate]

In terminal I just type firefox and then Firefox starts, but I can not return to command mode anymore. How can I come back to command mode? I have already tried :q or exit, but neither work.
1
vote
1answer
58 views

Formatting an external HDD with Bash script

At my workplace we have an external HDD connected to a NAS device (Synology). There is a backup tasks which runs weekly and fills the external HDD after a while. Unfortunately the Linux-based OS of ...
3
votes
2answers
108 views

Short, simple command to create a group if it doesn't already exist?

What is the cleanest way to modify this command in bash to only run if the group does not exist? groupadd somegroupname A one-liner would be best.
2
votes
1answer
39 views

Play .wav when text scrolls in terminal

After watching a TV show, I came up with a fun idea. Is there a way to take that cheesy high-pitched sound effect they play every time text scrolls down a command-line screen on TV and play it when ...
0
votes
1answer
32 views

Must pass urls in quotes

I'm trying pass a URL to mpv for it to play it as a network stream. This can be done in bash with the following syntax: $ mpv http://myvideosite.com However, zsh wants to evaluate the URL as ...
2
votes
2answers
150 views

Remove all lines in file A which contain the strings in file B

I have a CSV file users.csv with a list of userNames, userIDs, and other data: username, userid, sidebar_side, sidebar_colour "John Lennon", 90123412, "left", "blue" "Paul McCartny", 30923833, ...
6
votes
2answers
293 views

How to find out which program can open a given file?

Let's say I have a file thesis.pdf or picture.jpg Is there a command which returns a program to open this file with? I am aware of the command file, but it just returns the correct type of the file ...
4
votes
2answers
24 views

Use non-root user configuration for root account

When I work with the terminal and use su or sudo to execute a command with the root user's permissions, is it possible to apply the configuration of my "non-root user" (from which I am invoking su or ...
2
votes
1answer
67 views

Why are aliases missing inside of bash command?

When I run in my terminal: alias a list with all my aliases (defined in ~/bashrc and ~/.bash_aliases files) will be displayed on my terminal. That's nice and as expected! But when I run: bash -c ...
3
votes
2answers
163 views

Creating a messagebox using commandline

How can I create a message box using command-line to show a text‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌?
2
votes
0answers
49 views

How to make grub Command Line Default?

I'd like to make grub by default load it's command line instead of automatically booting from it's list of options generated by update-grub. How can I do this?
1
vote
2answers
135 views

wget to get all the files in a directory only returns index.html

I'm new to using bash, and I have been trying to wget all the files from a website to the server I have been working on. However all I'm getting back is an index.html file. I let it run for 15 minutes ...
24
votes
4answers
2k views

Is it possible to define a command in bash?

For example, can I set gb = cd /media/Dan/evolution So that everytime I execute gb in bash, I can cd to that particular directory? I find something online, alias command. But It seems can't do the ...
1
vote
4answers
108 views

How can I output the difference between 2 files?

My file consists of the the following; roughly: username:username:username:username:username The above line continues to about 600 characters. I use the awk command in order to use it as an ...
4
votes
3answers
99 views

Write text messages between Unix and Windows

Is it possible to send text messages between two users of the same LAN, but the first running Windows with cmd and the second running Linux/Unix? I am not looking for an instant messaging service. I ...
3
votes
1answer
60 views

Run command based on output of another command

OS: AIX 7100-04-1216 So basically I'm trying to write a for loop that sees which volumegroups I have on my system, which filesystems reside in those volume groups and what the size of each of those ...
2
votes
1answer
46 views

How can I make mailx inform me of new mail?

I'm trying to set up mailx on my server. On one server (Raspbian) I am informed of new mail with a message You have new mail (or something similar). On another machine (Raspbmc), I never have this ...
2
votes
2answers
56 views

How could I change Linux command to another key combination? [closed]

I'm using wmii, so Alt key Linux command was disabled. I want to change Ctrl+F and Ctrl+B to Alt+ F and Alt+ B so that I can use them to jump by word. But I searched on line, and didn't find ...
0
votes
0answers
14 views

command type “hashed”? [duplicate]

type displays information about a command's type. How would it be interpreted if used as a command name? What command "types" are there? In the following example, what does "hashed" mean? Is it ...
1
vote
3answers
86 views

Problem when splitting command with backslash in unix prompt

I often use the space-backslash combination ( ) to split a command and its parameters into various lines and make it more readable: /home/user> ls -ltra \ > file1.txt \ > file2.txt ...
3
votes
1answer
111 views

Check ping statistics without stopping

Is there a way to tell ping to show its usual termination statistics without stopping the execution? For instance, I'd like to quickly view: --- 8.8.8.8 ping statistics --- 2410 packets transmitted, ...
1
vote
1answer
45 views

Why does the same sed regex (after grep) fail when run in a bash script vs bash command line?

Here's the script. It is successful when I run it from the BASH prompt, but not in the script. Any ideas? When I say "fails," I mean the sed regex doesn't match anything, so there is no replaced ...