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

learn more… | top users | synonyms (1)

0
votes
1answer
48 views

Can I make alias for alias in bash?

In some circumstances, I need to make an official alias for a set of command, which acts just the same as the original software. Like: alias ipython3="source /Users/zen1/miniconda2/bin/activate py3k; ...
-3
votes
2answers
49 views

C Programming on command line [closed]

What to do after opening vim name.c and writing the source code? I mean, to compile and execute.
5
votes
8answers
400 views

Generate two sequences of numbers separated by “|”

I'm using bash (CentOS 5) and looking to generate this output (I assume I could use seq or echo together maybe?): 1|1, 2|2, 3|3, .... 31|31, 32|32, 33|33, I googled seq examples for over two hours ...
0
votes
0answers
27 views

Usage of the <<< operator [duplicate]

I recently ran across an example usage of the bc to output an expression like this: $ bc <<< "1+1" Which is the equivalent of: $ echo "1+1" | bc Does the <<< operator just ...
3
votes
1answer
128 views

How can I write data separately in many text files which contain the same fields?

I have a text file which contains around 9999999 lines. Here I'm pasting the few lines: 1874641047 Gazipur 1874646347 Jessore 1845105653 Chittagong 1845146123 Narayanganj 1845164162 Gazipur ...
2
votes
2answers
63 views

How to navigate the filesystem efficiently? [closed]

This question is on the "do everything through the terminal" mindset. I find navigating through the file system very inefficient. My typical workflow is: I want to go to ...
4
votes
1answer
94 views

How the terminal can run programs and show its output? [closed]

I'm slowly creating a mental model of how linux works, and I've tried to simplify the most, my model of how linux works. Let's assume that the kernel boots and inits the only software it's gonna run: ...
2
votes
2answers
73 views

How do I restore my boot partition manjaro/arch?

I need to completely rebuild my boot partition. The file system has sda1 250mb for boot and sda2 lvm luks encrypted with ManjaroVG-ManjaroHome, ManjaroVG-ManjaroRoot and ManjaroVG-ManjaroSwap inside ...
2
votes
1answer
28 views

How can I selectively modify the lines in a file where the modifications depend on analyzing the select lines as a whole rather than individually [duplicate]

TL;DR I need to align the columns of the entries in fstab while ignoring the comments: /dev/foo /foo ext4 defaults 0 2 # comment line 1 /dev/bar /bar ext4 defaults 0 ...
2
votes
1answer
68 views

Scroll by line in terminal rather than by page Shift + PgUp

Is there a keyboard way to scroll the terminal by line the same way we scroll with mouse wheel? Shift+PgUp/PgDown give only by-page scrolling. I would like to scroll slowly as with mouse wheel. My ...
1
vote
2answers
88 views

Remove file with pound signs around it [duplicate]

I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it ...
0
votes
2answers
27 views

How to auto run script upon driver reboot?

I am trying to set an auto run on my shell script (named driver_check.sh) which will trigger upon rebooting the driver. Basically, my script is as shown below: #!/bin/bash echo "Start script" ...
2
votes
1answer
88 views

.profile is written in shell script — can I instead make my system understand that I want it to execute a Python script instead?

I get Python. I don't get shell script. I could learn shell script, but I would rather not if I can use Python in its place. A good place for me to start would be the .profile script. Currently, for ...
0
votes
1answer
25 views

what grep -oh “[*?<com]” do?

I am trying to achieve something and in the experiment I came through following case , could somebody explain me how to understand whats happening. echo " Agent process not running on ...
0
votes
0answers
41 views

Editing a child JSON element value with jq

I'm trying to use jq in order to change a child's value. For instance, I want to change the value of "test2" from ["yo", "bye"] to ["hi"]. { "title": "hello", "body": { "test1": 123, ...
0
votes
0answers
15 views

ClamAV: suppress all output except summary

When using Clam AntiVirus from within GNU Bash, how should one invoke clamscan such that it will reliably suppress all output except the final summary? These attempts don't work: clamscan --quiet. ...
1
vote
1answer
50 views

How to Count the Number of Lines of an Output?

Let say I have the program: Calculate.py Is there a unix command-line that counts the number of lines outputted from my program, Calculate.py?
1
vote
3answers
43 views

combine selected column multi file

I have multiple files (~15), each with multi column data (tab seperated). For example: File1 aa1 399 1815 aa2 1908 4064 aa3 4523 5656 File2 bb1 5304317 5305057 bb2 ...
0
votes
2answers
76 views

In a folder with many files how to do rm on lots of them [duplicate]

I just experimented a bit in linux and ended up getting very many files in one and the same folder. Now when I try to do rm -f folder/*.png I get -bash: /bin/rm: Argument list too long ...
1
vote
1answer
45 views

pipe the output of cat into a node script

I am an absolute beginner at UNIX scripting (and have searched here for something explaining how to do this in a simple way to no avail). I am trying to pipe the contents of a claimName.txt file find ...
1
vote
1answer
52 views

How to read from stdin in process substitution? [duplicate]

I would like to send stdout to multiple commands, however I'm not sure how do I read from standard input within process substitution? My attempts: $ echo foo >(cat /dev/stdin) >(cat ...
1
vote
1answer
38 views

How to run commands on user login — that are NOT already running

I often run a series of poor-man daemons when I am sshing into my headless server. One to monitor the beer in my kegs and one to monitor the server itself from a web-browser. I do this by running ...
1
vote
1answer
27 views

Is there any way to list the latest GUI transactions in Linux?

Suppose that I've moved a directory in my Xfc desktop in another directory, which I can't remember the name of the destination directory. Is there any way to list the latest transactions in ...
1
vote
3answers
74 views

Command line tool to check when a URL was updated?

It would certainly be possible to whip together something in Python to query a URL to see when it was last modified, using the HTTP headers, but I wondered if there is an existing tool that can do ...
1
vote
1answer
27 views

Difference between writing `function Name { …; }`, `Name () { …; }` and `function Name () { …; }` in bash [duplicate]

You can write a bash functions several ways: function JoinStrings { ...; } Or function JoinStrings () { ...; } Or JoinStrings () { ...; } Is there any difference between these ...
2
votes
1answer
33 views

How to emulate returning arbitrary values from shell functions?

Shell functions are just statements and they don't return values. Can anyone share best practice on writing functions that return values in bash? Let's say I've a function that joins two strings: ...
0
votes
0answers
17 views

Difference between “$@” and “$*” when passing arguments to bash function [duplicate]

I'm having hard time understanding difference between $@ and $* when passing them to functions. Here is example: function a { echo "-$1-" "-$2-" "-$3-"; } function b { a "$@" } function c ...
3
votes
3answers
168 views

Repeating command with different filenames

Here's a layup for someone... I'm having to run a command repeatedly: $ wp input csv MyCSV01.csv directory_name $ wp input csv MyCSV02.csv directory_name $ wp input csv MyCSV03.csv directory_name ...
1
vote
1answer
76 views

Want to print NULL if value is not present as awk output

I am trying to print a tshark command output using awk below is my command: tshark -r "test.pcap" -odiameter.tcp.ports:"1234" -R 'diameter.cmd.code == 272 and diameter.flags.request==0 and ...
1
vote
2answers
37 views

path of folder within a folder in terminal

I have a number of files that are saved as Year -> Month -> Day -> bunch of .nc files I would like to generate a list of all of the directories that contain the nc files. I can list the ...
1
vote
1answer
38 views

Why doesn't cc (the C compiler) and similar utilities use standard streams by default? [closed]

Background If think most of us agree that filters and pipes are the very foundation of Unix systems. Pipes and filters are very powerful tools. Almost all Unix utilities use the standard input and ...
1
vote
1answer
103 views

Error when exporting the result of a valid command as a bash variable

I'm trying to export the result of a command line as en environment variable. Here is how I'm doing it: group_id=$(aws ec2 describe-security-groups --filters Name=group-name,Values=${group_name} \ ...
2
votes
2answers
61 views

How to kill line of PID?

I have process which created multiple PID's. I want to kill all those PID's. I have tried pkill <process_name>. But PID not getting killed as they were wait to resource releasing. I have ...
0
votes
1answer
28 views

Thunar custom action: Extraction to subdirectories

I am attempting to create a Custom Action in Thunar (File Manager) that will extract a gzip archive into a subdirectory of the same name (e.g. abc.tar.gz to abc/). I created this command, which works, ...
2
votes
2answers
75 views

Input from file: “advanced” (using less-than sign) vs. “beginner” syntax

I read the following in the grymoire: A simple example is changing "day" in the "old" file to "night" in the "new" file: sed s/day/night/ <old >new Or another way (for UNIX ...
0
votes
1answer
88 views

Re-encoding video with ffmpeg including all subtitles but not all audio

I'm trying to re-encode video streams from a Matroska file to save space, while keeping all the subtitles as-is, using ffmpeg. I want to write a generic command that works without me having to specify ...
2
votes
4answers
226 views

Interactively add arguments line-by-line in bash

Sometimes it happens that I have a list of files or strings in the clipboard and want to paste it as an argument list in a bash shell: Example file list (only an example): createsnapshot.sh ...
-1
votes
3answers
88 views

cannot move Directory not empty

Edited due to people want to know more then me just wanting to know how to deal with two directories with same names in different places and move one into another when mv will not allow it if files ...
1
vote
3answers
31 views

kill bash loop executed from command line [duplicate]

I run my command in a loop. I wrote the loop directly to a bash command line: $ while true; do mycommand; done mycommand is a command doing a lot of io and waiting for events so it does not consume ...
4
votes
1answer
79 views

What is the best way to pipe the output of a command through a pager if (and only if) it is too long?

I'd like to be able to be able to wrap a command so that if its output doesn't fit in a terminal it will be automatically piped through a pager. Right now I'm using the following shell function (in ...
1
vote
3answers
155 views

Opening current directory from a terminal onto a file browser?

My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to ...
0
votes
0answers
18 views

Bash previous command refresh is messed up [duplicate]

I'm running on a mac with el Capitan. I'm at the command prompt, running bash. When I hit the up-arrow, sometimes it's as if it thinks that my prompt is much longer than it is? The first part of the ...
8
votes
4answers
372 views

Compare two URL lists and print newly added URLs to a new file

I am initially producing two files which contain lists of URLs—I will refer to them as old and new. I would like to compare the two files and if there are any URLs in the new file which are not in the ...
1
vote
0answers
52 views

Is there a way to change KDE4 display settings from the command line?

Consider the following setup: My laptop is normally located at my desk connected to power, external keyboard and mouse and an external monitor. Since the laptop's screen is pretty small and my monitor ...
4
votes
2answers
67 views

how to tell firefox to shutdown cleanly from tty1?

Lately I run Firefox almost exclusively from on one of my Debian laptops (which run testing). Occasionally (~monthly) my desktop/tty7 hangs, in which case I usually can goto tty1 and sudo shutdown ...
0
votes
1answer
19 views

Splitting a flac from a cuesheet metadata block

Some flac files apparently have a “cuesheet metadata block”. I know how to split flacs files with shnsplit when I have a separate cuesheet at hand (cf. “How do I split a flac with a cue?”), but how do ...
5
votes
3answers
104 views

Is “Arithmetic Expansion” the expected action on vars inside `[[` tests?

This script: a=2 [[ "$a" -eq 2 ]] && echo yes1 [[ $a -eq 2 ]] && echo yes2 [[ a -eq 2 ]] && echo yes3 [[ "a" -eq 2 ]] && echo yes4 Does not work in dash (and ...
3
votes
4answers
248 views

How to show an environment variable's current value?

When I check on my system's environment, a lot of environmental variables will pop up. How can I just search for a particular variable? A book I'm reading says: Sometimes the number of variables ...
2
votes
1answer
77 views

Ubuntu live RTMP video streem

I'm trying to launch live(not ondemand) RTMP stream from ubuntu, but i succeed only with RTSP stream through VLC vlc -vvv ./videos/test.mp4 --sout ...
0
votes
1answer
53 views

How do I run a command on startup?

I need to run the same command every time I boot. I'm running Linux Mint 17.2 Cinnamon. I have added a startup application with the command under preferences "startup applications". However the ...